Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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