I am precompiling my templates using grunt-ember-templates. This tool is putting my templates in the Ember.TEMPLATES array, as expected. I am finetuning the configuration of grunt-ember-templates. For that I would like to know what is the expected key in the Ember.TEMPLATES array. Let's say I have this template:
<script type="text/x-handlebars" data-template-name="phones/index">
....
</script>
Currently I have this template in a file called app/templates/phones_index.hbs, and grunt-ember-templates is putting the pre-compiled template in Ember.TEMPLATES["app/templates/phones_index"], but this is wrong.
What is the expected key for data-template-name="phones/index"?
In your example the key in
Ember.TEMPLATESshould be "phones/index".You can configure grunt-ember-templates to drop the first part of your path and leave everything after
app/templates/which will give you the correct key assuming you place your template inside of fileapp/templates/phones/index.hbs. Using this set up, the key for theapp/templates/phones/index.hbsfile will beEmber.TEMPLATES['phones/index'], which is the same as having an uncompiled<script>tag withdata-template-name="phones/index".Gruntfile.js (same as the Gruntfile.js in this project):