Skip to content

Instantly share code, notes, and snippets.

@vvsalmin
Forked from mapohjola/application.controller.js
Last active October 22, 2015 07:06
Show Gist options
  • Select an option

  • Save vvsalmin/40bf89888d33cc554671 to your computer and use it in GitHub Desktop.

Select an option

Save vvsalmin/40bf89888d33cc554671 to your computer and use it in GitHub Desktop.
Component property binding
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
{{my-component test=bindingthisone}}
{{bindingthisone}}
<br>
<br>
import Ember from 'ember';
export default Ember.Component.extend({
test: "This is the wrong value",
didInsertElement: function() {
//this.set('test', 'this would work');
},
testing: function() {
// this doesn't bind to application template
this.set('test', 'it is working');
return "just tried to set 'test'";
}.property()
});
This is what I wanted
{
"version": "0.4.11",
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "http://builds.emberjs.com/tags/v2.1.0/ember.debug.js",
"ember-data": "http://builds.emberjs.com/tags/v2.1.0/ember-data.js",
"ember-template-compiler": "http://builds.emberjs.com/tags/v2.1.0/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment