mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-07 22:37:28 +08:00
docs(orderBy): clarify how sorting is processed
An API was passing me numbers as strings (ex. '8.25'), and I was noticing weird sorting behavior with `orderBy` because it was trying to sort the numbers alphabetically. Closes #5436
This commit is contained in:
committed by
Peter Bacon Darwin
parent
2022fd768e
commit
0d691a6feb
@@ -6,7 +6,9 @@
|
||||
* @function
|
||||
*
|
||||
* @description
|
||||
* Orders a specified `array` by the `expression` predicate.
|
||||
* Orders a specified `array` by the `expression` predicate. It is ordered alphabetically
|
||||
* for strings and numerically for numbers. Note: if you notice numbers are not being sorted
|
||||
* correctly, make sure they are actually being saved as numbers and not strings.
|
||||
*
|
||||
* @param {Array} array The array to sort.
|
||||
* @param {function(*)|string|Array.<(function(*)|string)>} expression A predicate to be
|
||||
|
||||
Reference in New Issue
Block a user