Reputation: 5644
When I pass a templateName
option to a View, Ember couldn't find the template with the corresponding name. I have created a template with the name nav-tabs.hbs
and passed 'nav-tabs'
to the templateName
property of an Ember.View
object.
All I get is an error about not being able to find a template with that name. When I check Ember.TEMPLATES
, it is empty. What am I doing wrong?
Upvotes: 1
Views: 333
Reputation: 215
In the Ember-CLI world, you want to use the ES6 import syntax, and supply your template to the View's template
property:
// app/views/my-view.js
import Ember from 'ember';
import Template from 'app/templates/my-template';
export default Ember.View.extend({
template: Template
});
Upvotes: 3