checkbox event.target.checked undefined
See original GitHub issueBug, feature request, or proposal:
Bug
What is the expected behavior?
<md-checkbox (click)="test($event)"></md-checkbox>
test(event) {
console.log(event.target.checked); // true | false
}
What is the current behavior?
<md-checkbox (click)="test($event)"></md-checkbox>
test(event) {
console.log(event.target.checked); // undefined
}
Which versions of Angular, Material, OS, browsers are affected?
@angular2-material/checkbox@2.0.0-alpha.7-2 @angular/core@2.0.0-rc.5 @angular/forms@0.3.0
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:17 (5 by maintainers)
Top Results From Across the Web
Why is '$event.target.checked' giving angular TypeError when ...
When i am trying to use $event.target.checked with angular mat-checkbox its giving an error sating that -"Cannot read property 'checked' of ...
Read more >How do I read out the value of my checkbox?
Try this: :) var selected = event.target.checked; //true or false.
Read more >Checkbox | Angular Material
Event emitted when the checkbox's indeterminate value changes. defaultColor: ThemePalette | undefined. Default color to fall back to if no value is set....
Read more >Angular 8 Checkbox Change Event Checked undefined
Im trying to execute a function when a checkbox has been ticked/unticked but wasnt able to get the checkbox.checked as it is showing...
Read more >Checkbox - (React) - Thumbprint Design System
onChange(event.target.checked, props.id, event) . Type. ( value: boolean, id: string | undefined ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This works properly for me:
try this: ツ