Reputation: 12005
I have this HTML code:
<tr *ngFor="let stud of [1,2,3]">
<mat-checkbox (change)="setPupilAbsence($event)"></mat-checkbox>
</tr>
And handler:
public setPupilAbsence(event: MatCheckbox): void {
event.checked = false;
}
Upvotes: 1
Views: 378
Reputation: 5944
The event.checked
property is probably immutable or only there for read purposes. Also, the event is not the MatCheckbox
itself, but it is MatCheckboxChange
.
You can use the source of the event: event.source.checked = false;
import {MatCheckboxChange} from '@angular/material';
...
setPupilAbsence(event: MatCheckboxChange) {
event.source.checked = false;
}
Upvotes: 3