uncheck all checkboxes typescript

Solutions on MaxInterview for uncheck all checkboxes typescript by the best coders in the world

showing results for - "uncheck all checkboxes typescript"
Enrico
22 Sep 2020
1html
2<input #checkboxes type="checkbox">
3...
4<button type="button" (click)="uncheckAll()"></button>
5
6ts file
7@ViewChildren("checkboxes") checkboxes: QueryList<ElementRef>;
8
9uncheckAll() {
10  this.checkboxes.forEach((element) => {
11    element.nativeElement.checked = false;
12  });
13}