How to allow angularJS custom filter to manupulate data single time

11 Views Asked by At

I have custom angularJS filter. Please let me know, how to get the same array of object those was checked once the condition entered into. Don't want to allow the filter to check everytime.

filter.js:

app.filter('sortFilter', ['$filter', function ($filter) {
    return function (items, sort, sort_iteratorr) {

if(sort_iteratorr == 1) {
  return items;
}
}]);

grid.php

<div ng-repeat="item in items | sortFilter: sort_string: sort_iteratorr">
</div>

Ctrl.js

$scope.sort_string = '';
$scope.sort_iteratorr = 1;
0

There are 0 best solutions below