Skip to content

Instantly share code, notes, and snippets.

@xm
Last active September 21, 2017 00:14
Show Gist options
  • Select an option

  • Save xm/54a067f9fc54d6ef9f61ce219ed3ff68 to your computer and use it in GitHub Desktop.

Select an option

Save xm/54a067f9fc54d6ef9f61ce219ed3ff68 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
tagName: ''
});
import Ember from 'ember';
export default Ember.Component.extend({
count: 0,
click() {
const count = this.get('count') + 1;
this.set('count', count);
this.$('p').text(`You've clicked me ${count} times`);
}
});
import Ember from 'ember';
export default Ember.Controller.extend({});
<button {{action (mut shouldRender) (if shouldRender false true)}}>
Toggle
</button>
{{my-component shouldRender=shouldRender}}
{{#if shouldRender}}
{{my-component/my-component-impl}}
{{/if}}
{
"version": "0.12.1",
"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.12.0",
"ember-template-compiler": "2.12.0",
"ember-testing": "2.12.0"
},
"addons": {
"ember-data": "2.12.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment