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

docs(orderBy): Clarify behavior of default comparator #15304

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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: 6 additions & 0 deletions docs/content/guide/migration.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -1226,6 +1226,12 @@ or simply use:
As communicated before, IE8 is no longer supported.


### Filters (`orderBy`)

- due to [a097aa95](https://github.com/angular/angular.js/commit/a097aa95b7c78beab6d1b7d521c25f7d9d7843d9),
the default orderBy comparator now treats null values as the string 'null'





Expand Down
2 changes: 2 additions & 0 deletions src/ng/filter/orderBy.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@
*
* **Note:** If you notice numbers not being sorted as expected, make sure they are actually being
* saved as numbers and not strings.
* **Note:** The above algorithm converts `null` values (normally of type `object`) to the string
* `'null'` (so has type `string`). This may cause unexpected sort order.
*
* @param {Array|ArrayLike} collection - The collection (array or array-like object) to sort.
* @param {(Function|string|Array.<Function|string>)=} expression - A predicate (or list of
Expand Down