diff --git a/docs/content/guide/migration.ngdoc b/docs/content/guide/migration.ngdoc index 6ddb29cb5a25..cf28bbb8f907 100644 --- a/docs/content/guide/migration.ngdoc +++ b/docs/content/guide/migration.ngdoc @@ -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' + + diff --git a/src/ng/filter/orderBy.js b/src/ng/filter/orderBy.js index a86f3a82ab90..c2f1a7da3906 100644 --- a/src/ng/filter/orderBy.js +++ b/src/ng/filter/orderBy.js @@ -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.)=} expression - A predicate (or list of