From 0d691a6febaa0fe24cd64ea19b1389a4003bfc92 Mon Sep 17 00:00:00 2001 From: Ryan Hall Date: Mon, 16 Dec 2013 11:18:45 -0800 Subject: [PATCH] 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 --- src/ng/filter/orderBy.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ng/filter/orderBy.js b/src/ng/filter/orderBy.js index 27891835..319950a1 100644 --- a/src/ng/filter/orderBy.js +++ b/src/ng/filter/orderBy.js @@ -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