Skip to content
Permalink
Browse files

docs(orderBy): clarify behavior of default comparator wrt `null`

Document how `orderBy`'s default comparator handles `null` values.

Fixes #15293

Closes #15304
  • Loading branch information
arw-travela authored and gkalpak committed Oct 20, 2016
1 parent c1bfe43 commit 35f91232560e82b3b94ee1e48c98a42e3d12a866
Showing with 7 additions and 1 deletion.
  1. +4 −1 docs/content/guide/migration.ngdoc
  2. +3 −0 src/ng/filter/orderBy.js
@@ -1125,7 +1125,11 @@ and "$dependentProvider" would have actually accomplished something and changed
app. This is no longer possible within a single module.


### Filters (`orderBy`)

- due to [a097aa95](https://github.com/angular/angular.js/commit/a097aa95b7c78beab6d1b7d521c25f7d9d7843d9),
`orderBy` now treats `null` values (which in JavaScript have type `object`) as having a string
represenation of `'null'`.


### Animation (`ngAnimate`)
@@ -1229,7 +1233,6 @@ or simply use:




## Migrating from 1.0 to 1.2


@@ -86,6 +86,9 @@
*
* **Note:** If you notice numbers not being sorted as expected, make sure they are actually being
* saved as numbers and not strings.
* **Note:** For the purpose of sorting, `null` values are treated as the string `'null'` (i.e.
* `type: 'string'`, `value: 'null'`). This may cause unexpected sort order relative to
* other values.
*
* @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

0 comments on commit 35f9123

Please sign in to comment.
You can’t perform that action at this time.