Angular 8 Is there a way to stop triggering [disabled]="somefunc()" function on button on every keystroke?

183 Views Asked by At

Here is the code snippet:

 <button mat-icon-button [disabled]="isNextStepDisabled()" (click)="nextStep()">
        <mat-icon style="cursor: pointer">navigate_next</mat-icon>
 </button>

isNextStepDisabled() {
  console.log('In isNextStepDisabled');
}

I am using Angular 8 with material stepper.

Noticed that isNextStepDisabled() function is being called every key stroke in the form (actually in any form once the step is active). How not to trigger it but only when user moves away from some fields?

0

There are 0 best solutions below