Skip to content

Instantly share code, notes, and snippets.

@siva-sundar
Last active February 4, 2016 09:59
Show Gist options
  • Save siva-sundar/3d5b56053da427eb4e6b to your computer and use it in GitHub Desktop.
Save siva-sundar/3d5b56053da427eb4e6b to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
show: true,
computedWithoutKey: Em.computed(function() {
return this.get('show');
}),
computedWithKey: Em.computed('show', function() {
return this.get('show');
}),
actions: {
toggle() {
this.toggleProperty('show');
}
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
controllerProp: {{show}}
<br>
<br>
computedWithoutKey: {{computedWithoutKey}}
<br>
<br>
computedWithKey: {{computedWithKey}}
{{outlet}}
<br>
<br>
<button {{action 'toggle'}}>toggle</button>
{
"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