View: templateName vs. template

Hey,

the properties template and templateName of a View seem to differ quite a lot. Now i wanted to set up a view, render the template via

template: Ember.Handlebars.compile(LoginTemplate),

but this doesn’t work with a Router. If i do:

templateName: "login"

it works. But i’d appreciate loading the template as a module, not in the same .html file nor with a .html build process. Any suggestions?

1 SOLUTION FOUND:

Ember.TEMPLATES["login"] = Ember.Handlebars.compile(LoginTemplate);

If you do this for the required templates, you can access the template in the view via templateName (“login” in this case…)

1 Like