In the view of a directive I have two ng-repeats. This directive builds a table, and the data of every table cell is from another datasource. This datasource needs the cumulative index of the two repeaters.
selectedKandidaat.AntwoordenLijst[$index].Value
I only have got the current $index, or the $parent.$index. So to keep track of the overall index that I want to use in Antwoordenlijst[$index] I will need to keep track of an index variable. Can I just use create and update an index variable in the view.
Something like this:
..
{{ totalIndex = 0 }}
<tr ng-repeat="opgave in opgaven">
<td ng-repeat="item in opgave.Items">
{{ totalIndex += 1 }}
..
The actual code
<table class="table">
<tr ng-repeat="opgave in opgaven">
<td ng-repeat="item in opgave.Items">
<select ng-model="selectedKandidaat.AntwoordenLijst[$index].Value"
ng-options="alternatief for alternatief in item.Alternatieven">
</select>
</td>
</tr>
</table>