Skip to content
This repository was archived by the owner on Apr 4, 2019. It is now read-only.
This repository was archived by the owner on Apr 4, 2019. It is now read-only.

Access array by index inside "each" block #388

@dmoreno

Description

@dmoreno

I have two arrays:

var array1 = [ "a", "b", "c"];
var array2 = [ "x", "y", "z"];

And I try to interate with an each block by this way:

{{#each array1 as |item index|}}
  1. {{index}} : {{item}}
  2. {{array2.[0]}}
  3. {{array2.[index]}}
{{/each}}

First and second lines works as expected. But third line is empty.

I tried several ways but no one works:

array2.index
array2.[index]
array2.[(index)]
array2.[@index]

What is the way to interate over a second array using index? Could it be a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions