Within the scope of a directive, I am working with two ng-repeats. This directive is responsible for generating a table, and each table cell's data comes from a separate data source. This data source requires the cumulative index of the two repeaters.
selectedKandidaat.AntwoordenLijst[$index].Value
Currently, I only have access to the current $index or the $parent.$index. In order to keep track of the overall index required for Antwoordenlijst[$index], I will need to manage an index variable. Can I simply create and update an index variable in the view?
Perhaps something like this:
..
{{ totalIndex = 0 }}
<tr ng-repeat="opgave in opgaven">
<td ng-repeat="item in opgave.Items">
{{ totalIndex += 1 }}
..
The current implementation:
<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>