I have a nested ng-repeat and I am trying to retrieve the overall count of all records.
Despite my attempts to declare a variable within the view and increment it, it doesn't seem to work as expected.
Here is the current code snippet:
<body ng-app="app">
<div class="table-responsive" ng-controller="quotesController">
<div ng-repeat="info in datos2 track by $index">
<h2><strong>{{info.name}}</strong></h2>
<div ng-init='count()' ng-repeat="dato in data track by $index">
<span>{{dato.name}}</span>
<br> Position {{id}}
<br />
</div>
</div>
</div>
</body>
AngularJS Code:
$scope.count=function(){
number = number + 1;
$scope.id=number;
}
My goal is for each ng-repeat loop to display the corresponding position number.
Example:
Name 1 ITEM 1 - Position 1
ITEM 2 - Position 2
Name 2 ITEM 1 Position 3
ITEM 2 - Position 4
Name 3 ITEM 1 - Position 5
ITEM 2 - Position 6