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

docs(filter): clarify the comparator parameter #15827

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ng/filter/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
*
* The final result is an array of those elements that the predicate returned true for.
*
* @param {function(actual, expected)|true|false} [comparator] Comparator which is used in
* determining if the expected value (from the filter expression) and actual value (from
* the object in the array) should be considered a match.
* @param {function(actual, expected)|true|false} [comparator] A predicate to further refine the
* search results of an object or string expression. It should be used to determine if the
* actual value from the array is equal to the expected value from the filter expression.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH, I feel this change is more confusing. E.g. comparator is not used to "further refine the search results". And "should be used" sounds more like the user should do something (vs AngularJS using the function under the hood). And also actual is not necessarily a "value from the array", but can be a property or sub-property of an item in the collection/array.

*
* Can be one of:
*
Expand Down