Is it good/bad practice to disable an Angular button with a component method? Specifically, Would this be a performance issue in Angular? It seems like Angular would have to continuously calculate.
Is it better to use a static variable (eg this.productDisable: boolean), and just let it calculate at certain times?
isProductSaveDisabled() {
if (this.productsSelected == null || this.productsSelected ?.length === 0) {
return true;
} else {
return false;
}
}
HTML:
<button mat-raised-button [disabled]="isProductSaveDisabled()" (click)="saveAll()">
Save Product
</button>
Curious reading loot of tutorials and articles using class methods, etc