vendredi 18 octobre 2019

i am using angular material checkbox in my code . i need the checkbox to be selected all by default in the list page

My mat-checkbox is not selected all by default. Check my code below.

<mat-checkbox (change)="$event ? masterToggle() : null" 
[checked]="selection.hasValue() && isAllSelected()"
[indeterminate]="selection.hasValue() && !isAllSelected()" 
[aria-label]="checkboxLabel()"></mat-checkbox>
</mat-header-cell>
<mat-cell *matCellDef="let row">
<mat-checkbox (click)="$event.stopPropagation()"
(change)="$event ? selection.toggle(row) : null"
[checked]="selection.isSelected(row)" 
[aria-label]="checkboxLabel(row)">
</mat-checkbox>



Aucun commentaire:

Enregistrer un commentaire