Does Emberjs provide selectionBinding for the checkbox to handle selected/checked checkbox options.
If yes, how to do it?
Bind to the checked
property of Ember.Checkbox
, see http://jsfiddle.net/5pnVg/:
Handlebars:
{{view Ember.Checkbox checkedBinding="App.objController.isChecked" }}
JavaScript:
App.objController = Ember.Object.create({
isChecked: true,
_isCheckedChanged: function(){
var isChecked = this.get('isChecked');
console.log( 'isChecked changed to %@'.fmt(isChecked) );
}.observes('isChecked')
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With