Skip to content

Instantly share code, notes, and snippets.

@thousand
Last active August 18, 2016 20:41
Show Gist options
  • Save thousand/84657547771f87ff1856060634126579 to your computer and use it in GitHub Desktop.
Save thousand/84657547771f87ff1856060634126579 to your computer and use it in GitHub Desktop.
yield
import Ember from 'ember';
export default Ember.Component.extend({
myThing: 'some thing',
init() {
this._super(...arguments);
this.set('myThing', 'it\'s a thing!')
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
<h1>Welcome to {{appName}}</h1>
{{#main-component}}
<h3>Yield'd</h3>
{{thing}}
{{/main-component}}
{{outlet}}
<h2>Main</h2>
{{yield (hash thing=myThing)}}
{
"version": "0.10.4",
"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.7.0",
"ember-data": "2.7.0",
"ember-template-compiler": "2.7.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment