mardi 26 mai 2015

How to render multiple templates using #each in a handlebars?

I have one array of objects inside this objects I have some list of id's and using this id's I have to render multiple templates using #each loop for handlebars.

Simple this statement will return me the list of containing names of template.

{{#each data in sections1}}
{{data.id}}
{{/each}}

Output :

A B C D E F G H I J K L M N O P Q R S T U V W X

Consider this all A to Z are different template names respectively Now I'm trying to render all these templates using #each loop in handlebar But I don't know the exact syntax.

For example can we do like this way ?

{{#each data in sections1}}
{{render data.id}} //Here I'm getting error Because of it is not exact syntax
{{/each}}




Aucun commentaire:

Enregistrer un commentaire