mercredi 4 février 2015

How can I use templates outside of the render pipeline

I have an event where I need to insert a template into space outside of the app. With Ember-CLI we have all these wonderfully pre-compiled templates, so I'm trying to figure out how I can use one.


(Ember-CLI 0.0.42, Ember 1.7.0)


I found I can get the pre-compiled template function like this:



import TheTemplate from 'app/templates/the-template';


However, if I call it as documented on the Handlebars website, I get an error.



var context = { button: "OK" };
var str = TheTemplate(context);

Uncaught TypeError: Cannot read property 'push' of undefined


So what is the proper way to use these templates?





Aucun commentaire:

Enregistrer un commentaire