https://stackblitz.com/edit/angular-material-wuzktn?file=app%2Fapp.component.css
<mat-checkbox (click)="$event ? masterSelect() : null"
[checked]="selection.hasValue() && isAllSelected()"
[indeterminate]="selection.hasValue() && !isAllSelected()" #check>
Master select
</mat-checkbox>
{{selection.hasValue() && isAllSelected()}}
{{check.checked}}
<mat-checkbox *ngFor="let row of data" (change)="$event ? selection.toggle(row) : null"
[checked]="selection.isSelected(row)">
{{selection.isSelected(row)}}
</mat-checkbox>
当我单击“主复选框”时,我想选择下面的所有复选框,并且可以使用,但“主复选框”不会更改值。当我检查它时,mat-checkbox checked
属性为false。也不存在mat-checkbox-checked类。