Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save stefanpenner/e4e7bebc07c5c7bf713407b3b222a0f4 to your computer and use it in GitHub Desktop.
Save stefanpenner/e4e7bebc07c5c7bf713407b3b222a0f4 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
isChecked: false,
label: 'laber before input'
});
import Ember from 'ember';
export default Ember.Controller.extend({
isPillChecked: false,
actions: {
togglePill() {
// i may want to set specific value
this.toggleProperty('isPillChecked');
}
}
});
<h2>Click few times on label see how it works</h2>
<h2>Then click few times on checkbox and see how it works</h2>
{{toggle-pill
isChecked=isPillChecked
click=(action "togglePill")
}}
<span>{{label}}</span>
{{input
type="checkbox"
checked=isChecked
}}
<span>{{isChecked}}</span>
{
"version": "0.11.0",
"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.10.2",
"ember-data": "2.11.0",
"ember-template-compiler": "2.10.2",
"ember-testing": "2.10.2"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment