mercredi 1 avril 2015

Ember.js / access to parent array within each - nested each

I have the following Model in Ember.js



App.Fraction.FIXTURES = [
{
id : 200,
title : "General",
list : 100,
provider : [400],

attributes : [800,801]
}, {
id : 201,
title : "Kinder Preise",
list : 100,
provider : [400]
}


];


Each Fraction has Providers and Attributes and each Provider has Services. I want to create a Table for each Provider with the provider.services as rows and the attributesas coloumns.


In my Template i tried this:



{{#each provider}}
<h3>{{title}}</h3>
<hr />

<table>
<thead>
<tr>
{{#each ../attributes}}
<th> {{title}} nothing happend!!!</th>
{{/each}}
</tr>
</thead>

<tbody>
{{#each services}}
<tr>
<td> {{title }}</td>
{{#each attributes}}
<td>{{value}}</td>
{{/each}}
</tr>
{{/each}}
</tbody>
</table>
{{/each}}


It seems like the path identifier "thing" does not work here. Is there a workaround?


Thanks!





Aucun commentaire:

Enregistrer un commentaire