Skip to content

Instantly share code, notes, and snippets.

@pablobm
Created August 16, 2018 14:49
Show Gist options
  • Save pablobm/e0f104d9caa89f7c22c077fc5f737850 to your computer and use it in GitHub Desktop.
Save pablobm/e0f104d9caa89f7c22c077fc5f737850 to your computer and use it in GitHub Desktop.
Valid paths for component templates
<p>This is the component</p>
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
<p>The Ember API documentation, as of version 3.3, incorrectly states that you can create a template-only component at the path <code>app/components/my-component.hbs</code>.</p>
<p>This simple example refutes this, by using this path and breaking. Try moving the file <code>components/my-component.hbs</code> to one of the following locations, and this example will run correctly:</p>
<ul>
<li><code>components/my-component/template.hbs</code></li>
<li><code>templates/components/my-component.hbs</code></li>
</ul>
{{my-component}}
{
"version": "0.15.0",
"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.2.2",
"ember-template-compiler": "3.2.2",
"ember-testing": "3.2.2"
},
"addons": {
"ember-data": "3.2.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment