0
votes

I'm using Grunt and Yeoman to precompile my handlebars templates for an ember app.

In the tutorial they write:

<script type="text/x-handlebars" data-template-name="todos">
...
</script>

Instead I have a file todos.hbs

Now I have to create a template:

<script type="text/x-handlebars" data-template-name="todos/index">
</script>

What syntax do I use to make a todos/index .hbs file?

2

2 Answers

0
votes

create a new folder todos in the template directory and create an index.hbs file in it.

1
votes

Is your todos/index a nested ressource?

With Grunt in this case, I put my todos.hbs in the parent folder of the nested ressource, render only the {{outlet}}-tag in it and put todos/index named as index.hbs in a subfolder called todos. Inside these templates, i usually omit the <script type="text/x-handlebars" data-template-name="todos/index">...</script> part, because Grunt recognizes them based on their filename.

If your routes are not nested, you should be able to do the same without the subfolders. Correct me if I'm wrong

Be sure to configure your Grunt to watch subfolders for changes when doing it that way. See this thread I hope this helps