Actually i am trying to set a field as readonly or disabled in ionic2 form as:
<ion-item>
<ion-label fixed>Category <ion-icon name="ios-arrow-forward"></ion-icon></ion-label>
<ion-input type="text" [disabled]="false" id="category_name" class="form-control" formControlName="category_name" (click)="category()" [(ngModel)]="category_name"></ion-input>
</ion-item>
I also used [readonly]="false".
I know it's an issue with also there are issues on git :
https://github.com/driftyco/ionic/issues/6408 ..
So any help how i could fix it out.
I have used this to solve in Ionic 2:
In .ts file:
------------
isReadonly() {
return this.isReadonly; //return true/false
}
In .html file:
--------------
<ion-input type="text" [readonly]="isReadonly()"></ion-input>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With