select all checkbox in angular material code example
Example: select all checkbox in angular
Prepared a small demo to show how this can be done using ngModel directive. Link: https://stackblitz.com/edit/angular-lxjrdh
It uses Array.every to check if all are checked or not. If checked, it resets all otherwise checks all.