This is a problem that extended from Click Return wrong Index after Sorting !
> <tr ng-repeat="item in items | orderBy:'Store.storeName'">
<td><input class="toggle" type="checkbox" ng-model="item.Completed"></td>
<td>{{item.Name}}</td>
<td>{{item.Quantity}} Stk.</td>
<td>{{item.Price || 0 | number:2}} €</td>
<td>{{item.Quantity*item.Price|| 0 | number:2}} €</td>
<td>{{item.Store.storeName}}</td>
<td><a><img src="img/delete.png" ng-click="removeItem(item)">{{$index}}</a></td>
So in his question he try to remove the item in the array after sorting, which "$index" wouldn't return the correct index, so the solution suggested to pass back "item" itself as a parameter and use "indexof(item)" function.
My question is what if I want to compare the value after sorting?
Since the $index does not reflect the actual sorted index in the new sort array I cant not compare calculate the value of item.Price between the first item and second item in the sorted array.
What is the best approach?