I believe you can do:
<div class="row"
ng-repeat="row in grid track by $index"
ng-init="$rowIndex = $index">
<div cell class="cell"
ng-repeat="cell in row track by $index"
ng-click="game.addItem($rowIndex, $index)">
{{cell.value}}
</div>
</div>
(Init may need to go to the external div, I can’t remember how I am sitting here)
Although the question will ask why you cannot just use the cell and row, what do you need indexes for for.
source
share