As stated here, Ember 1.13 needs a key for the {{each}}
helper. Since Ember 1.13.2 the default key is @identity
.
Now I am trying to fix my code, I have an each loop nested inside another (piece of code that shows an calendar). I get the following error:
Uncaught Error: Duplicate key found ('(null)') for '{{each}}' helper, please use a unique key or switch to '{{#each model key="@index"}}{{/each}}'.
But even if I add a @guid
as key, the error is still shown. Code:
{{#each weeks key="@guid" as |week|}}
<tr>
{{#each week key="@guid" as |day|}}
<td class="day"></td>
{{/each}}
</tr>
{{/each}}
I don't understand that. As @guid
should create an unique identifier for each object, why do I still get this duplicate key found
error?
EDIT:
My assumption that Duplicate key found
had anything to do with nested each loops was plainly wrong. After trying to build a fiddle as Kitler proposed, I did understand my problem (see the answer).