Checkbox inputs and value attributes

I know I am a late comer in this discussion, but I have been studying this issue and have found the following solution that some may find helpful. I wanted to find a solution that used the native Ember input helper for a checkbox {{input type=checkbox }} that could call an action that could manipulate values or class names or whatever else I fancied. I discovered as Chris did that you can not use ‘value=variable’ with the input helper. I also had no luck using action=“someAction” on=“click”. I tried many varieties of the action call but none worked. So finally this is what I came up with that achieved everything I wanted. As you can see it does not call an action but rather in the component controller it defines a variable to hold the boolean value for “checked”, and a method outside of the regular actions feature that simply observes the checked variable so that it fires whenever a change occurs which in this case is whenever the checkbox is clicked. I offer this because I has to look so hard and so long for a solution. I hope it helps those who are also looking for a solution. Peace. (Have no idea how you guys formatted your code with such a limited text editor :slight_smile: )

In Component template hbs:

{{input type=“checkbox” checked=myVal }}

In Component Controller js file:

myVal: false,

toggleCheckbox: function() {

 //change values or classes or whatever else you wish to do

}.observes(‘myVal’)