tedour
tedour

Reputation: 63

Meteor 1.2 : A way to access {{../@index}}

I use meteor 1.2

Here is my code :

{{#each steps}}
{{#each buttons}}
<button class="car-action-button" data-step-index="{{../@index}}" data-button-index="{{@index}}" data="{{../idOnMap}}" data-cid="{{../../cid}}">
</button>
{{/each}}
{{/each}}

{{../@index}} should return the steps rank but doesn't return anything. Is ther a way to do that ?

Upvotes: 0

Views: 129

Answers (1)

tedour
tedour

Reputation: 63

Ok, here is my solution :

{{#each steps}}
{{#let index = @index}}
{{#each buttons}}
<button class="car-action-button" data-step-index="{{index}}" data-button-index="{{@index}}" data="{{../idOnMap}}" data-cid="{{../../cid}}">
</button>
{{/each}}
{{/let}}
{{/each}}

Hope it help someone :)

Upvotes: 3

Related Questions