@barneycarroll wrote:
A component needs to be fed items at the same index from 2 associated arrays,
list1&list2. How can I access an item from an array at an interpolated index inside a Handlebars expression?Loop initialisation:
{{#each list1 as | item index |}} {{! loop body}} {{/each}}As a preliminary sanity check, I can confirm that the list is accessible, and querying it with literal indices using this delightful syntax will work:
{{log list2.[0]}}But the following loop bodies will throw template parser errors:
{{log list2[index]}} {{log list2.@index]}}The following don't output anything:
{{log list2.[index]}} {{log list2.index}} {{log list2.[@index]}}On further reading, the
gethelper as a nested expression seems appropriate, but these didn't give me any luck:{{log (get figures index)}} {{log (get figures @index)}}Any other ideas?
Posts: 1
Participants: 1