I have a json structure:
let total_price = "£100";
let product_groups = [
{
"name": "group 1",
"summary": "group 1 summary",
"products": [
{
"name": "product 1",
"price": "£10",
...
},
...
]
},
...
]
I am trying to flatten this and display it using a table in the following form
<table class="table">
<thead>
<tr>
<th>Group Name</tr>
<th>Product Name</tr>
<th>Product Price</tr>
</tr>
</thead>
<tbody>
<tr ng-repeat="group in product_groups">
<td>{{group.name}}</td>
<td>{{product.name}}</td>
<td>{{product.price}}<td>
</tr>
<tr>
<th colspan="2">Total</th>
<td>{{total_price}}</td>
</tr>
</tbody>
</table>
But this obviously doesnt give me access to each product. Is there a way I can do this using an ng-repeat? Or will I need to flatten my data structure first in the controller?