On this page
Improve this Doc View Source filter
- filter in module ng
Overview
Selects a subset of items from array and returns it as a new array.
Usage
In HTML Template Binding
{{ filter_expression | filter : expression : comparator : anyPropertyKey}}
In JavaScript
$filter('filter')(array, expression, comparator, anyPropertyKey)
Arguments
| Param | Type | Details |
|---|---|---|
| array | Array |
The source array.
Note: If the array contains objects that reference themselves, filtering is not possible.
|
| expression | stringObjectfunction() |
The predicate to be used for selecting items from Can be one of:
|
| comparator
(optional)
|
function(actual, expected)truefalse |
Comparator which is used in determining if values retrieved using Can be one of:
Defaults to |
| anyPropertyKey
(optional)
|
string |
The special property name that matches against any property. By default |
Example
© 2010–2020 Google, Inc.
Licensed under the Creative Commons Attribution License 3.0.
https://code.angularjs.org/1.8.2/docs/api/ng/filter/filter