Reputation: 16367
How to check is checkbx is checked or not
it is always showing true
<div>
<input type="checkbox" (keyup)="0" #grade value="true">
{{grade.value}}
</div>
Upvotes: 1
Views: 924
Reputation: 28939
You can do as
.html
<mat-checkbox #checkbox (change)="onChange(checkbox.checked)"></mat-checkbox>
.ts
onChange(checked: boolean) {
console.log(checked)
}
Upvotes: 0
Reputation: 16367
Now it is correct with
<div>
<input type="checkbox" #grade (change)="0">
{{grade.checked}}
</div>
Upvotes: 3