I have a list of items that need to be displayed with serial numbers. I tried using $index with ng-repeat, but when an element is hidden, the index increases unexpectedly.
The code I attempted is as follows:
<div ng-repeat="itemRow in salesitem" class="tableRow h7" ng-hide="itemRow.flagDeleted">
<div class="tableCell">{{$index}}</div>
<div class="tableCell">{{itemRow.name}}</div>
<div class="tableCell">{{itemRow.qty}}</div>
</div>
When itemRow.flagDeleted is True and the item is not displayed, the index still increments, causing the serial numbers of the subsequent items to be incorrect.