Search code examples
htmlember.jshandlebars.jsember-dataeach

Iterate an array with respect to another array's index in handlebars


{{#each locationTable as |locationShifts index|}}
   {{#each get reasons index as |value|}}
     {{value}}
   {{/each}}
{{/each}}

I want to do something like this. Using 2 helpers at once "each" and "get". How can i achieve something like this?


Solution

  • It would be

    {{#each (get reasons index) as |value|}}
      {{value}}
    {{/each}}
    

    but I'm not 100% sure if get works for numeric indexes on arrays.