adds an additional 'suspend' parameter to built-in angular filters
/** where suspend is a boolean, true|false **/
filter(args, suspend[true|false]);
{{ filter:arg:arg:suspend[true|false] }}
bower install angular-filter-suspend --save
Note: The return value of a filter that was initially suspended would be the first value passed to said filter. This differs to some extent from what the native return values are. Check the angular docs for a reference point.
If however the filter was not suspended initially, but at a later point in time it was - the last state of the un-suspended filter would be the returned value.
angular.module('yourModule', [ 'angular.filter.suspend' ]);
/**
* in .js land
*/
numberFilter(number, fraction, suspend);
dateFilter(date, format, timezone, suspend);
jsonFilter(json, spacing, suspend);
lowercaseFilter(lowercase, suspend);
limitToFilter(limitTo, limit, begin, suspend);
orderByFilter(orderBy, expression, reverse, suspend);
filterFilter(filter, expression, comparator, suspend);
<!-- in .html land -->
{{ number_expression | number : fractionSize : suspend }}
{{ date_expression | date : format : timezone : suspend }}
{{ json_expression | json : spacing : suspend }}
{{ lowercase_expression | lowercase : suspend }}
{{ limitTo_expression | limitTo : limit : begin : suspend }}
{{ orderBy_expression | orderBy : expression : reverse : suspend }}
{{ filter_expression | filter : expression : comparator : suspend }}
npm install; npm test
MIT © Kasper Lewau