angularjs - angular ng-repeat prefilter in javascript -
i have following angular js filter ng-repeat
on tr element. how accomplish of in javascript? possible in 1 custom filter?
note: showrow function returns bool, search string string
ng-repeat="lob in filtered = (lobs | filter : showrow | filter : searchstring | orderby : 'name':true )
you can use $filter service, or $scope.$eval:
$filter('orderby')( $filter('filter')( $filter('filter')($scope.lobs, $scope.showrow), $scope.searchstring), 'name', true); $scope.$eval("lobs | filter : showrow | filter : searchstring | orderby : 'name':true");
not tested, should close enough work.
and yes, using first way, create own filter that.
Comments
Post a Comment