Reputation: 7162
Is there a way I can get ng-repeat current record index? I am trying to give each record div an id equal to the record index example:
<div id="1">
<div id="2">
<div id="3">
Any example is highly apreciated.
The ng-repeat i am using is as follows:
<div ng-repeat="rows in clients.Result">
Upvotes: 0
Views: 816
Reputation: 8520
$index
contains the current index. So you can use it inside your ng-repeat
like {{$index}}
.
All these variables are documented at the very top of the ng-repeat
documentation.
Upvotes: 4
Reputation: 29836
Use $index with evaluation curls:
<div id="{{$index}}" ng-repeat="rows in clients.Result">
Upvotes: 4