From 73a89bd33efc96698995170d26eebf5cd3e86e20 Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Sun, 22 Feb 2015 19:27:30 -0600 Subject: [PATCH] docs(orderBy): Start with a simpler example. Per the question raised at this Stack Overflow question: http://stackoverflow.com/questions/24048590/angularjs-ng-repeat-orderby-date-not-working The first example on this page is too complex to convey the simplest possible case for using this function. Sentences to put examples 1 and 2 in context. --- src/ng/filter/orderBy.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/ng/filter/orderBy.js b/src/ng/filter/orderBy.js index 58b4c4bcd3e9..6df6906a47ec 100644 --- a/src/ng/filter/orderBy.js +++ b/src/ng/filter/orderBy.js @@ -34,6 +34,41 @@ * @param {boolean=} reverse Reverse the order of the array. * @returns {Array} Sorted copy of the source array. * + * To make AngularJS perform a sort, add orderBy to the ng-repeat. + * The example below demonstrates setting the predicate to '-age' and reverse * to false. + * + * @example + + + +
+ + + + + + + + + + + +
NamePhone NumberAge
{{friend.name}}{{friend.phone}}{{friend.age}}
+
+
+
+ * The predicate and reverse parameters can be controlled dynamically through variables, + * as shown in the next example. * @example