These are chat archives for ractivejs/ractive

4th
Dec 2018
fiskrens
@fiskrens
Dec 04 2018 07:53
When nesting {{each}}, is it possible to get the index of the parent item?
kouts
@kouts
Dec 04 2018 07:56
{{#each items: item_index}}
you can set your own name for the index so that you can get it in the inner loop
fiskrens
@fiskrens
Dec 04 2018 08:00
@kouts, the problem is that the item_index returns the key. In my case it is an object with strings instead of numbers.
kouts
@kouts
Dec 04 2018 08:01
then try {{#each someObject: k, i}} ... {{/each}} k is the current key and i is the current index
fiskrens
@fiskrens
Dec 04 2018 08:02
@kouts, cool, thanks!
kouts
@kouts
Dec 04 2018 08:02
:thumbsup: