Compiling templates from external source at runtime


I’m an utter n00b where Ember is concerned, so be gentle with me. I’m currently having a poke around with different libraries and frameworks as an evaluation exercise after years of painting myself in a corner with procedural jQuery self-harm.

I’m dislike the idea of templates in script tags just hanging about like chavs at a bus stop (to an unreasonable degree). So, I wrote a little something to fetch and compile templates from the server using something like this …

Ember.TEMPLATES[name] = Ember.Handlebars.compile(data);

The problem is that if I use handlebars helper expression like #link-to in the application template then the links refuse to work. Even if I carry out the template loading after all the routes have been mapped.

Any help on how to get around this would be greatly appreciated.

Many thanks Pobble