Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit b5a5623

Browse files
kylewuollegkalpak
authored andcommitted
docs(filterFilter): mark the comparator parameter as optional
Mark the `comparator` parameter as optional and mention that it defaults to `false`. Fixes #15312 Closes #15371
1 parent 3e87f54 commit b5a5623

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/ng/filter/filter.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
*
4242
* The final result is an array of those elements that the predicate returned true for.
4343
*
44-
* @param {function(actual, expected)|true|undefined} comparator Comparator which is used in
44+
* @param {function(actual, expected)|true|false} [comparator] Comparator which is used in
4545
* determining if the expected value (from the filter expression) and actual value (from
4646
* the object in the array) should be considered a match.
4747
*
@@ -54,13 +54,14 @@
5454
* - `true`: A shorthand for `function(actual, expected) { return angular.equals(actual, expected)}`.
5555
* This is essentially strict comparison of expected and actual.
5656
*
57-
* - `false|undefined`: A short hand for a function which will look for a substring match in case
58-
* insensitive way.
57+
* - `false`: A short hand for a function which will look for a substring match in a case
58+
* insensitive way. Primitive values are converted to strings. Objects are not compared against
59+
* primitives, unless they have a custom `toString` method (e.g. `Date` objects).
5960
*
60-
* Primitive values are converted to strings. Objects are not compared against primitives,
61-
* unless they have a custom `toString` method (e.g. `Date` objects).
6261
*
63-
* @param {string=} anyPropertyKey The special property name that matches against any property.
62+
* Defaults to `false`.
63+
*
64+
* @param {string} [anyPropertyKey] The special property name that matches against any property.
6465
* By default `$`.
6566
*
6667
* @example

0 commit comments

Comments
 (0)