Closed SpBills closed 3 years ago
Code example:
{{#each (getarray "colors") as |t| }} <div class="card d-flex flex-column p-5 m-2 w-25"> <div class="card-body"> <h5 class="card-title">Title: {{t.title}}</h5> <p class="card-text">Name: {{t.content}}</p> <small>{{@index}}</small> </div> </div> {{else}} <p>WRONG</p> {{/each}}
The getarray helper accesses the array_fields field on the data of the template. array_fields is a hashmap. We access the correct array by the argument of the getarray helper.
getarray
array_fields
Code example:
The
getarray
helper accesses thearray_fields
field on the data of the template.array_fields
is a hashmap. We access the correct array by the argument of thegetarray
helper.