I'm looking for an easy, reliable way to lazy load templates in Ember 1.10 but can't find much. This SO question and this discuss.emberjs both ask something similar to what I need for this application.
I've set up Grunt with grunt-ember-templates
to pre-compile the templates. But, by the end of this development, the minified JS file will be in the 3-4 megabyte range, which is not an option.
The questions mentioned above were asked over a year ago. Has anything changed that Handlebars, or better yet HTMLBars templates can be loaded as they're needed? I feel like I'm missing something entirely! Ember was built exactly for the purpose of creating robust applications.
-
Edit: The lack of suggestions on a better way to manage template files is worrying. I'm not sure how this wasn't considered a problem right from the start of ember development? There is the strategy of using a beforeModel
hook but shouldn't adding templates on-the-fly be implemented already?
Simply put, if I want to display a .hbs
template inside an HTML file without pre-compiling, what is the easiest and fastest way?