I have dynamic inputData array (length can be between 0 and 10 or 15) that looks something like this:
$scope.inputData = [
[1, 2, 3, 4, 5, 6, 7];
[1, 2, 3, 4, 5, 6, 7];
[1, 2, 3, 4, 5, 6, 7];
[1, 2, 3, 4, 5, 6, 7];
[1, 2, 3, 4, 5, 6, 7];
[1, 2, 3, 4, 5, 6, 7];
]
I need to generate td in the table with ng-repeat so I could have an only first item from each "sub-array" in the first iteration. Then only second item from each "sub-array", etc.. So table should be
th th th th th th
1 1 1 1 1 1
2 2 2 2 2 2
3 3 3 3 3 3
...
And ng repeat should switch indexes in each iteration.
// first iteration:
<td ng-repeat="item in inputData track by $index">{{item[0]}}</td>
// second iteration:
<td ng-repeat="item in inputData track by $index">{{item[1]}}</td>
...
Can I somehow solve this only using ng-repeat or should I sort my arrays in the controller?