Skip to content

Instantly share code, notes, and snippets.

@bekzod
Created January 10, 2016 18:51
Show Gist options
  • Save bekzod/8752439c256b833ebfde to your computer and use it in GitHub Desktop.
Save bekzod/8752439c256b833ebfde to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
{{my-component count=6}}
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['my-component'],
countMinusOne: Ember.computed('count', function(){
return this.get('count') - 1;
})
});
{{#if countMinusOne}}
{{my-component count=countMinusOne}}
{{countMinusOne}}
{{/if}}
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
.my-component {
border: 2px solid green;
padding: 10px;
}
{
"version": "0.5.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.2.0/ember.debug.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.2.0/ember-data.js",
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.2.0/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment