Skip to content

Instantly share code, notes, and snippets.

@ppcano
Last active November 2, 2018 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ppcano/99d0503c3480b272c9529f64034ea30d to your computer and use it in GitHub Desktop.
Save ppcano/99d0503c3480b272c9529f64034ea30d to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
import layout from '../templates/components/other-template';
export default Ember.Component.extend({
layout
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{my-component}}
<br>
<br>
<p>my-component expects to yield the `other-template.hbs` content with the Component.layout</p>
This behaviour is documented at
<a href="https://www.emberjs.com/api/ember/3.5/classes/Component/">Component.layout API</a>
<br/><br/>
------
<br/>
YIELD -> {{yield}}
<br/>
------
<br/><br/>
But this is not working as it is documented, if you rename or remove the default template (`my-component.hbs`), `my-component` will use instead the layout template.
<br/><br/>
It looks the documentation is wrong.
{
"version": "0.15.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.4.3",
"ember-template-compiler": "3.4.3",
"ember-testing": "3.4.3"
},
"addons": {
"ember-data": "3.4.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment