@cortez.connelly
You can get the checkbox state in Ember.js by using the checked
attribute.
1
|
<input type="checkbox" checked={{checkboxState}} {{action 'toggleCheckbox'}}> |
1 2 3 4 5 6 7 8 |
checkboxState: false, actions: { toggleCheckbox() { this.toggleProperty('checkboxState'); console.log(this.get('checkboxState')); // This will log the current state of the checkbox } } |
Now, whenever the checkbox is clicked, the checkboxState
property will toggle between true
and false
, and you can access its current state in your component or controller.