You do not need to use $parent , just use $index to get the index of the inner loop and use indexOf () . array function to get the outer loop index ...
HTML
<tr ng-repeat="element in body"> <td ng-repeat="h in header" style="width:{{h.width}}px"> <div col="{{body.indexOf(element)}}" row="{{$index}}">{{element[h.column]}}</div> <td> </tr>
UPDATE
In fact, using ng-init it would be much better to get the index of the outer loop ... here you can easily set rowIndex to the current index at each step and use it in the inner loop ...
<tbody> <tr ng-repeat="element in body" ng-init="rowIndex = $index"> <td ng-repeat="h in header" style="width:{{h.width}}px"> <div col="{{$index}}" row="{{rowIndex}}">{{element[h.column]}}</div> <td> </tr> </tbody>
here is updated PLUNKER
Poyraz yilmaz
source share