How can I disable ion-input
?
<ion-input type="text"></ion-input>
I'm new at Ionic Framework, it is rather similar to HTML, but there is no property for attribute to disable it like:
.prop("disabled", true)
Ionic 2:
Static property:
<ion-input disabled="true" type="text"></ion-input>
Dynamically:
<ion-input disabled="{{isDisabled}}" type="text"></ion-input>
After in the component(.ts file):
private isDisabled: boolean=false;
disabled in small characters, it works on the boolean mechanism. bind the object of true and false so you will get the result.
<ion-input disabled="{{inputDisabled}}" [(ngModel)]="drill_plus" placeholder="Drill Plus" type="number"></ion-input>
your ts export class
inputDisabled: boolean = false;
condition
this.inputDisabled = true;
works for me. try this, hope you will get the answer.
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