I want to do some arithmetic operation with $index in ng-repeat.
The following code is not working:
<tr ng-repeat="item in quotation.items track by $index">
<td class="text-center"><strong>{{$index++}}</strong></td>
<td><a href="javascript:void(0);">{{item.item}}</a></td>
<td>{{item.quantity}}</td>
<td>{{item.rate}}</td>
<td>{{item.rate * item.quantity}}</td>
</tr>
How can I solve this?
$index + 1, as$index++tries to change the actual value of your loop variable.