Ember CLI container framework - place additional templates in each container
I just migrated my Ember app to use the pod framework by adding a property podModulePrefix
to my app. All route templates, the controller supporting the route template, and the route itself exist:
app/
modules/
route_name/
template.hbs
controller.js
route.js
Now I am doing a lot of manual switching from the named dot patterns. Thus, a route template can contain two named exits, as well as 4 or 5 templates that can be mapped to these exit points at any given time. For now, these additional templates are in the Ember-CLI templates directory:
app/ templates/ route_name/ temp1 temp2
One activity that might exist on my route might contain this call:
this.render('route_name/temp1', {outlet: 'named', into: 'route_name'});
What steps need to be taken to make the templates located in the templates folder on the container resolvable:
app/
modules/
route_name/
template.hbs
controller.js
route.js
templates/
temp1
And how would I then refer to temp1
in this.render()
?
source to share
This is done by creating a folder with the desired name and placing it template.hbs
inside.
app/
modules/
route_name/
template.hbs
controller.js
route.js
temp1/
template.hbs
Subscriptions are not all or nothing, so you can also create a template in:
app/ modules/ ... templates/ route_name/ temp1.hbs
The resoller will first look for a path along the path and then return to the "traditional" locations. To make this happen, you can include ENV.APP.LOG_RESOLVER = true;
inenvironment.js
source to share