I know that in angular2 I can disable a button with the
[disable]
attribute, for example:
<button [disabled]="!isValid" (click)="onConfirm()">Confirm</button>
but can I do it using [ngClass]
or [ngStyle]
? Like so:
<button [ngStyle]="{disabled : !isValid}" (click)="onConfirm()">Confirm</button>
Thanks.
See Question&Answers more detail:os