For Ember 1.0, templates must be defined in index.html or in separate files that are provided to your application through the build tool.
Some examples:
If you really want to place your template in JavaScript, you can put it in your application template:
<script type="text/x-handlebars"> {{view App.MyView}} </script>
And then define your view:
App.MyView = Ember.View.extend({ template: Ember.Handlebars.compile("Whatever you want here") });
So the happy path in Ember is to use external templates for each of your routes, either in your HTML when you start, or use the build step so that you can leave them outside your index.html.
source share