I'm using Blaze from Meteor for html template, and I have multiple loop like :
let objects = [{name: 'John', age: 18}, {name: 'Foo', age: 25}, {name: 'Bar', age: 35}]
let attrs = ['name', 'age']
{{#each objects}}
<h3>Object {{@index}}</h3>
{{#each attrs}}
[...] // code here
{{/each}}
{{/each}}
I know :
{{@index}}
is used to know the current loop index (so on[..]
{{@index}}
is a ref to index on attrs array{{this}}
is used to know the current loop value (so on[...]
{{value}}
isname
orage
){{..}}
is a ref to the parent loop value (so on[...]
{{..}}
is the current object, on first loop)
Now, I want on [...]
the current index for the objects
loop. I search a lots on Google and Stackoverflow but didn't found.