ng-User ng-User - 4 days ago 4
AngularJS Question

Getting number of $index of a table row in angularjs

How can I get the number of index from the following example in js (angularjs)

<tr ng-hide="group.$hideRows" ng-repeat="customer in group.data>
<td>({{$index + 1}}) </td> // << get this number ???
<td>{{customer.name}}</td>
<td>{{customer.city}}</td>
<td>{{customer.tel}}</td>
<td>{{customer.etc}}</td>
<td>{{customer.reg}}</td>
</tr>


The index in my case is 10. But how can I get this value as variable to work with in other functions?

I tried it with
$index.length
etc. But I didn't get the value 10.

Answer

If I correct understand question - you get count of items in array with:

group.data.length