Closed dnish closed 8 years ago
Also pass the values you need:
{{#each getArray}}
{{>item position="{{@index}}" prop1=this.prop1}}
{{/each}}
Or the entire object in one shot:
{{#each getArray}}
{{>item position="{{@index}}" item=this}}
{{/each}}
Ah okay, thank you for the information. Think I will use the seconds solution.
Hey, I'm just trying to access the current index of my array to generate a top 100 list with ViewModel. This is the typical Blaze syntax:
With ViewModel, I would generate something like this
But how can I access the @index value in my item VM? My first solution was to add this value to it's context:
But this would override the whole context of each item.