Angular - Unselect all Checkbox

248 views Asked by At

I was able to successfully Add Select All functionality when checkbox is clicked. However I am unable to Uncheck All when all items are already selected

Here is the link to code - https://stackblitz.com/edit/angular-material-select-all-aota2app.component.html

1

There are 1 answers

2
tsu On BEST ANSWER

Your function unselectAll() has never been called

<mat-checkbox (ngModelChange)="selected = !selected" [ngModel]="checked">Check/ Uncheck</mat-checkbox>