I'm struggling with this seemingly simple issue, and I could really use some assistance.
In the JavaScript file of the component -
weekShorts: computed(function() {
return new Array('S', 'M', 'T', 'W', 'T', 'F', 'S');
}),
Then, in the hbs file -
{{#each day in weekShorts}}
<td> {{day}}</td>
{{else}}
<td>
No items in days
</td>
{{/each}}
Despite trying the above code, the output consistently shows "No items in days".
Interestingly, when simply printing {{weekShorts}} elsewhere, it displays
S,M,T,W,T,F,S
Why is the #each loop failing to iterate over the array?
UPDATE - It has been suggested that for version 2.x you should follow this format:
{{#each weekShorts as |day|}}
<td> {{day}}</td>
{{else}}
<td>
No items in days
</td>
{{/each}}