This is my code
<a href="" ng-click="predicate = 'productname'; reverse=false">Productname</a>
<a href="" ng-click="predicate = 'productprice'; reverse=false">Productprice</a>
Iteration
<div ng-repeat="sale in sales | orderBy:customSort">
Customsort function
$scope.customSort = function(sale) {
};
Currently in the customSort function I get all the sale data but I also want to pass the predicate value to the function so that it can sort accordingly(sort by name if name is clicked, sort by price if price predicate is clicked.)
How can I pass the predicate value to the customSort function?Can any one please help me with this? Thanks.
orderBy, not 100% clear what intent is here because mixing several issues