Skip to content

Instantly share code, notes, and snippets.

@eddie-ruva
Created September 22, 2016 00:13
Show Gist options
  • Save eddie-ruva/70b28b0d9dc7ac46621aafa76ee23f95 to your computer and use it in GitHub Desktop.
Save eddie-ruva/70b28b0d9dc7ac46621aafa76ee23f95 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
myProperty: {
a: 1,
b: 2
},
key: 'a',
actions: {
changeKey(key) {
this.set('key', key);
}
}
});
<h1>Welcome to {{appName}}</h1>
{{ get myProperty key}}
<button {{action (action 'changeKey' 'a')}}>My Button A</button>
<button {{action (action 'changeKey' 'b')}}>My Button B</button>
{
"version": "0.10.5",
"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.8.0",
"ember-data": "2.8.0",
"ember-template-compiler": "2.8.0",
"ember-testing": "2.8.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment