I am trying to find whether the checkbox is checked or not in a controller.
Here's my template:
<script type="text/x-handlebars">
{{view Ember.TextField valueBinding="firstname" placeholder="First Name"}}
<input type="checkbox" name="remember_me"> Remember me </input>
<button {{action save }}>Save</button>
</script>
Here's my controller:
App = Ember.Application.create();
App.ApplicationController = Ember.Controller.extend({
save: function(){
//need to get the value of "remember_me" here
alert(this.get("firstname"));
}
});
How can I get the value of "remember_me" (whether it's checked or not) in the controller. Can I do valueBinding on the check box. If so , can you please give me an example syntax.
jsfiddle: