I have this button:
<button class="btn btn-primary btn-sm" (click)="addSupplier(item)">Save</button>
I would like to add a class 'disabled' that will only applied when a certain condition is true, and will not apply when it is false.
What is the Angular 2 way of doing this? I came up with this approach using *ngIf but it's a ton of code:
<div *ngIf="item.productId && item.supplier">
<button class="btn btn-primary btn-sm" (click)="addSupplier(item)">Save</button>
</div>
<div *ngIf="!item.productId || !item.supplier">
<button class="btn btn-primary btn-sm disabled" (click)="addSupplier(item)">Save</button>
</div>