Skip to content

Instantly share code, notes, and snippets.

@alexspeller
Created February 19, 2016 17:56
Show Gist options
  • Save alexspeller/be74878680e88d42bfac to your computer and use it in GitHub Desktop.
Save alexspeller/be74878680e88d42bfac to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
boundProp: "initial value"
});
boundProp in controller: {{boundProp}}
{{my-component boundProp=boundProp}}
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
foo() {
this.set('boundProp', 123);
}
}
});
boundProp in component: {{boundProp}}
<button {{action 'foo'}}>Set boundprop from component</button>
{
"version": "0.5.3",
"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.3.1/ember.debug.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.3.3/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