Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
didRender() {
console.log('didRender');
console.log('pojo1', this.get('pojo1'));
console.log('pojo2', this.get('pojo2'));
}
});
import Ember from 'ember';
import Pojo from '../pojo';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
export default class Pojo {
constructor() {
this.foo = 'bar';
}
};
import Ember from 'ember';
export default Ember.Route.extend({
setupController(controller) {
let pojo1 = {
foo: 'bar'
};
let pojo2 = {
bar: 'foo'
};
console.log('pojo1', pojo1);
console.log('pojo2', pojo2);
controller.set('pojo1', pojo1);
controller.set('pojo2', pojo2);
}
});
{{my-component pojo1=pojo1 pojo2=pojo2}}
<h1>My Component</h1>
<p>Foo is: <b>{{pojo1.foo}}</b></p>
{
"version": "0.7.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"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.4.3/ember.debug.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.4.3/ember-data.js",
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.3/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.