Ekaitz Hernandez Troyas Ekaitz Hernandez Troyas - 1 month ago 7
HTML Question

Display a list of items in Ember not working with each

I am trying to display a list of items in Ember.js but is not working and I don't get any error in the console. If I go to a specific element it works but I can't iterate the array.

<h1> Forecast 16 days </h1>

// this line works
{{model.[0].clouds}}

// this block doesn't work
{{#each item as |model|}}
<div>{{item.clouds}}</div>
{{/each}}

GUL GUL
Answer

The each block params are inverted. It should be

{{#each model as |item|}}
    <div>{{item.clouds}}</div>
{{/each}}