Trying to get the value of checked and unchecked checkbox values when clicking on the every checkbox. How to do it? How to handle the mat-checkbox events? If anyone knows please help to find the solutions.
<mat-autocomplete #auto="matAutocomplete" [displayWith]="displayFn">
<mat-option
*ngFor="let data of filteredData | async"
[value]="data"
[disabled]="isDisable(data)"
>
<div (click)="optionClicked($event, data)">
<mat-checkbox
[checked]="data.selected"
(change)="toggleSelection(data)"
(click)="$event.stopPropagation()"
[disabled]="isDisable(data)"
>
{{ data.item }}
</mat-checkbox>
</div>
</mat-option>
</mat-autocomplete>
Demo: https://stackblitz.com/edit/angular-ivy-ebuzba?file=src%2Fapp%2Fshared%2Fmauto%2Fmauto.component.ts