Skip to content

Instantly share code, notes, and snippets.

@kumkanillam
Created July 28, 2016 06:24
Show Gist options
  • Save kumkanillam/6b0c00d90592aff8e459d55911c30c8d to your computer and use it in GitHub Desktop.
Save kumkanillam/6b0c00d90592aff8e459d55911c30c8d to your computer and use it in GitHub Desktop.
checkbox change with mut helper
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
statusObj:{status:false},
actions:{
test(){
console.log('test',this.get('statusObj'));
}
}
});
<h1>Welcome to {{appName}}</h1>
<br>
{{input type="checkbox" checked=statusObj.status on-change=(action (mut statusObj.status) checked) }}
<br>
<button {{action 'test'}}> OK </button>
{{outlet}}
<br>
<br>
{
"version": "0.10.2",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.7.0",
"ember-data": "2.7.0",
"ember-template-compiler": "2.7.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment