Tengo una columna con botones en una mesa de tapete. Según un valor, verifico si el botón debe estar habilitado o deshabilitado y funciona bien. El problema es que si el usuario hace clic en un botón deshabilitado, obtendrá un error. ¿Cómo puedo deshabilitar el evento de clic para un botón deshabilitado?
<ng-container matColumnDef="download"> <th mat-header-cell *matHeaderCellDef>download</th> <td mat-cell *matCellDef="let element"> <mat-button [disabled]="isDisabled(element.status)" (click)="download(element.value)"> download </mat-button> </td> </ng-container><ng-container matColumnDef="download"> <th mat-header-cell *matHeaderCellDef>download</th> <td mat-cell *matCellDef="let element"> <mat-button [disabled]="isDisabled(element.status)" (click)="!isDisabled(element.status) && download(element.value)"> download </mat-button> </td> </ng-container>