Trigger an action on the change event with Ember.js checkbox input helper?
问题 How can I fire a named action upon changing a checkbox in Ember.js? Any help will be greatly appreciated. Here is what I have. Checking or unchecking the checkbox has no effect. Template: {{input type="checkbox" on="change" action="applyFilter"}} Controller: actions: { applyFilter: function() { console.log("applyFilter"); } } 回答1: using an observer seems like the easiest way to watch a checkbox changing Template {{input type='checkbox' checked=foo}} Code foo:undefined, watchFoo: function(){