答案 0 :(得分:3)
单击selectAll方法时,可以将所有值分配给handletType属性。
尝试一下:
selectAll(){
this.handlerType = this.handlerTypeSelect;
}
答案 1 :(得分:1)
selectAll(select: NgModel, values, array) {
select.update.emit(values);
}
deselectAll(select: NgModel) {
select.update.emit([]);
}
尝试
否则
尝试
<mat-checkbox class="mat-option"
(click)="$event.stopPropagation()"
(change)="selectAll(/* Check to see if you want to check/uncheck all, do that here */)"
[indeterminate]="itemsSelected.length && itemsNotSelected.length"
[checked]="!itemsNotSelected.length">
Select All
</mat-checkbox>