Inner loops within "template 7"


#1

I have a object like this:

data.users (list of users)
user.hobbies (list of hobbies)

all is stored in data. I want to iterate it:

{{#each data.users}} 
{{#each hobbies}}
	<td class="label-cell">
		{{name}} // {{this.name}} also not work
	</td>
{{/each}}
{{/each}}

it does not work. normally, in loops I have a reference:

for(var h in hobbies) {
h.name 
}

but with template 7, the “ref” of “h” is not explicitly declared within {{each}}.
For example, this would be better:

{{#each user of data.users}} 
{{#each hobby of user.hobbies}}
	<td class="label-cell">
		{{hobby.name}}
	</td>
{{/each}}
{{/each}}

#2

Can you provide an example of data object you pass to template?


#3

Was my fault, the object was not injected. I use now this to inject the object within my router-component:

options: {
			// Custom template context
			context: {
		              users: users,
		        },

And the templating works. Thanks.