I am trying to disable the div tag after successfully invoking this action.
see my ionic content
<ion-content padding class="forgot-password"> <div [ngClass]="{active: isOn,disabled: isDisabled}"> <ion-item> <ion-label floating>Email/Mobile</ion-label> <ion-input type="text" [(ngModel)]="loginId"></ion-input> </ion-item> <br><br> <button class="float-right" (click)="generateOTP(!isOn);">Send OTP</button><br><br><br> </div> <br> <div *ngIf="showRePasswd"> <ion-item> <ion-label floating>Enter OTP</ion-label> <ion-input type="text" [(ngModel)]="passwd"></ion-input> </ion-item> <br><br> <button class="float-right" (click)="resetPassword();">Send Password</button> </div> </ion-content>
here is my .ts file
export class ForgotPasswordPage { public loginId = ""; public passwd = ""; public showRePasswd = false; isDisabled = false; isOn = false; constructor(private navCtrl: NavController, private logger: Logger, private user: Users) { } generateOTP(newstate) { this.logger.info("invoking generateOTP FN"); var _this = this; this.user.generateOTP(this.loginId, function(result,data){ if(result == '1') { alert(data); _this.showRePasswd = !_this.showRePasswd; _this.isDisabled = true; _this.isOn = newstate; } else {
I tried [ngClass] , but I can’t disable my div tag after a successful callback.
I also tried using [disabled] but did not work
Here is a demo to disable the div tag, but in my case it doesn't work
My requirement is for my input field and button to be disabled after a successful callback
angular ionic2 angularjs-ng-disable
Mohan gopi
source share