Search code examples
htmlangularcheckboxunselect

Angular - Unselect all Checkbox


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


Solution

  • Your function unselectAll() has never been called

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