Ich möchte angleJS verwenden und eine ng-Wiederholung verwenden, um meine Daten anzuzeigen. Ich habe ein JSON, wo ich eine bestimmte Reihe von Elementen nach ID/Name gruppieren muss. Ich bin nicht sicher, wie man den bestimmten Ausgang erreicht. Ich habe ein Snipped mit dem Ausgang hinzugefügt, den ich benötige.Mehrere ng-repeat in einer Tabellenzeile
var obj = [{
"id": 101,
"name": "Victor",
"address": "Mumbai"
"order": [{
"itemName": "Bulb",
"quantity": 10
},
{
"itemName": "Soap",
"quantity": 3
},
{
"itemName": "Towel",
"quantity": 1
}
]
},
{
"id": 102,
"name": "Francis",
"address": "Nagpur"
"order": [{
"itemName": "Remote",
"quantity": 1
},
{
"itemName": "Bread",
"quantity": 2
}
]
}
]
<table border="1" width="100%">
<tr>
<th>Id</th>
<th>Name</th>
<th>Address</th>
<th>Item Name</th>
<th>Quantity</th>
</tr>
<!--- below is the output that i want -- uncomment and see the output -->
<tr>
<td>101</td><td>Victor</td><td>Mumbai</td><td>Bulb</td><td>10</td>
</tr>
<tr>
<td></td><td></td><td></td><td>Soap</td><td>3</td>
</tr>
<tr>
<td></td><td></td><td></td><td>Towel</td><td>3</td>
</tr>
<tr>
<td>102</td><td>Francis</td><td>Nagpur</td><td>Remote</td><td>1</td>
</tr>
<tr>
<td></td><td></td><td></td><td>Bread</td><td>2</td>
</tr>
</table>
Vielen Dank Santosh, das war wirklich kewl. ich hatte noch nie einen ng-repeat-start und ng-repeat-end verwendet. Das sieht perfekt aus was ich brauche und die Tags sehen auch semantisch richtig aus. – nipiv
@nipiv Cool, akzeptiere die Antwort, wenn gelöst :-) – Santosh