Hay alguna forma de desactivar (con disabled) los demás checkbox que no están seleccionados excepto el que seleccione ? Tengo este código.
HTML:
<table mat-table [dataSource]="data">
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef>
Nombre
</th>
<td mat-cell *matCellDef="let element">
{{ element.nombre}}
</td>
</ng-container>
<ng-container matColumnDef="products">
<th mat-header-cell *matHeaderCellDef > productos </th>
<td mat-cell *matCellDef="let element;let i = index">
<mat-checkbox
[(ngModel)]="element.producto"
[checked]="select === i"
(change)="select = i;">
</mat-checkbox>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="listcolumns"></tr>
<tr mat-row *matRowDef="let row; columns: listcolumns"></tr>
</table>
TYPESCRIPT:
selected = -1;
listcolumns: string[] = ['name','products'];
public data: MatTableDataSource<any>;
Este fragmento de código , proviene de un mat-table , donde select = -1 , lo que hace es que cada ves que pique a un check se desactive el otro check anterior, pero me gustaría que si pico a un check , los demás checkbock se desabilitaran con disabled excepto el que esta seleccionado, hay alguna forma de hacer eso?