I have a json array that contains x number elements where each one is another json array. I want to iterate over this array using a nested ng-repeat
, something like nested ng-repeat.
My problem is I want to do it in a "vertical table":
<!-- for the big json -->
<table ng-repeat = "obj in data "style="width:100%">
<tr>
<th>data01</th>
<!--for thr first object in the big json -->
<tr ng-repeat = "var in obj">{{var}}</tr>
</tr>
<tr>
<!--for the second object in the big json -->
<th>data02</th>
<tr ng-repeat = "var in obj">{{var}}</tr>
</tr>
</table>
data
[ "data01":[{"firstName":"John", "lastName":"Doe"}], "data02":["{"firstName":"Anna", "lastName":"Smith"}], "data03":[{"firstName":"Peter","lastName":"Jones"}] ]
So the first ng-repeat
will be for each object, and the second will inseart values to the 'right' side of the table.
I can't find the correct way to organize the HTML elements so it will display them in this order. Here is an example for what I mean by "vertical table".