Skip to content

Instantly share code, notes, and snippets.

@tomasznapieralski
Last active April 24, 2017 19:31
Show Gist options
  • Save tomasznapieralski/5a5574717bf6475c56170381f83ba029 to your computer and use it in GitHub Desktop.
Save tomasznapieralski/5a5574717bf6475c56170381f83ba029 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.set('isPillChecked', true);
}
}
});
<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