I am trying to add filter on image click .Actually there is an icon in my demo "V" consider only first one near "inject" on header.I apply click event on that .Actually I want to add orderBy filter in first column on click of image. what I did I reverse the array on button click .But may be come condition when my array is not sorted then I need to first sort the given array .That what I am trying to add filter on image click .I try to read documentation of orderBy but there is nothing written how can we use button click event . https://docs.angularjs.org/api/ng/filter/orderBy
Javascript code
$scope.sortdata = function() {
//alert('--')
$scope.displayData=$scope.displayData.slice().reverse();
};
here is my code http://plnkr.co/edit/FqL7g2w5yLEREopY4B10?p=preview Here my code is working fine when user click image is come ascending and descending order.but when array is not sorted it is not work ?