I have a small problem I would save $ index to reuse it in the next ng repeat,
I explain, I created an object array that has the same size as my json array
this is my object array
$scope.valeur[index] = {
'BODY':"",
'TYPE':"",
'PARAMETRE': ""
};
this is a picture of my json
So my $ index run 2 time and then 5 time and me I would like that from the first round it save the variable and it starts the next ng repeat has the previous value (here 1)
this is my ng-repeat
<div ng-repeat="(key, item) in dataApi track by $index" >
<div u ng-repeat="(key, itemHead) in item track by $index" ng-init="firstIndex == undefined ? firstIndex = $index : firstIndex = $index+firstIndex" >
{{firstIndex }}
</div>
</div>
I tested with the ng-init but I have nothing concrete
i someone can help me
thanks in advance
EDIT
here is that i want, so it's with the ng-repeat of the 2nd level that I want to save the value,
1st round of ng-repeat level 2 Index starts at 0 And finished at 1
2nd round of ng-repeat level 2 Index starts at 2 (value of previous $index+1) And finished at 6
heres is a picture
Because I need to have a consistency with my object array
example 1st round Index = 0 $ scope.value [index] Index = 1 $ scope.value [index] 2nd round Index = 0 $ scope.value [index]
So problem because my index is 0 and not 2
Or else I would just need a variable that counts the number of times I am switching to the ng repeat lvl2

