Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70762

Disable/Enable of ion-input using angular reactive forms

$
0
0

@abhibly wrote:

Hello i have an ionic app where i am trying to disable the ion-input using reactive forms some thing like this.

    Disable(){
      this.name.disable();
      this.name.updateValueAndValidity();
    }

And When i try to enable the input element its not working

     Enable(){
       this.name.enable();
       this.name.updateValueAndValidatity();
     }

The html code looks like this:

      <ion-item>
         <ion-input type="text" [formControl]="name"></ion-input>
      </ion-item>
      <button ion-button (click)="Disable()">Disable</button>
      <button ion-button (click)="Enable()">Enable</button>

The above code works fine with html5 input element but not with ionic elements.Can somebody please tell is there something i am missing.I have made a demo example here:https://stackblitz.com/edit/ionic-nl1hi3?file=pages%2Fhome%2Fhome.html

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70762

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>