Skip to content

Instantly share code, notes, and snippets.

@bugant
Forked from alexspeller/application.controller.js
Created February 22, 2016 09:17
Show Gist options
  • Save bugant/3273626ee3e8850a9494 to your computer and use it in GitHub Desktop.
Save bugant/3273626ee3e8850a9494 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({
initBoundProp: Ember.on('init', function() {
this.set('boundProp', 'foo');
}),
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": "1.13.13",
"ember-data": "2.0.1",
"ember-template-compiler": "1.13.13"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment