Skip to content

Instantly share code, notes, and snippets.

@sunishsheth2009
Created October 27, 2016 01:52
Show Gist options
  • Save sunishsheth2009/ae6812e7dece83fbadb655b3f1d082ae to your computer and use it in GitHub Desktop.
Save sunishsheth2009/ae6812e7dece83fbadb655b3f1d082ae to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
init() {
this.set('goodModel', false);
this.set('badModel', false);
},
actions: {
updateGoodFit(value) {
if(!this.get('goodModel') === true) {
this.set('goodModel', value);
this.set('badModel', !value);
}
},
updateBadFit(value) {
if(!this.get('badModel') === true) {
this.set('badModel', value);
this.set('goodModel', !value);
}
}
}
});
<input type="checkbox" name='re' checked={{goodModel}} onchange={{action "updateGoodFit" value="target.checked"}}>
<input type="checkbox" name='re' checked={{badModel}} onchange={{action "updateBadFit" value="target.checked"}}>
{
"version": "0.10.6",
"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.9.0",
"ember-data": "2.9.0",
"ember-template-compiler": "2.9.0",
"ember-testing": "2.9.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment