aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ng/filter/orderBy.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ng/filter/orderBy.js b/src/ng/filter/orderBy.js
index b6262698..faeb8ed1 100644
--- a/src/ng/filter/orderBy.js
+++ b/src/ng/filter/orderBy.js
@@ -74,6 +74,12 @@ function orderByFilter($parse){
predicate = predicate.substring(1);
}
get = $parse(predicate);
+ if (get.constant) {
+ var key = get();
+ return reverseComparator(function(a,b) {
+ return compare(a[key], b[key]);
+ }, descending);
+ }
}
return reverseComparator(function(a,b){
return compare(get(a),get(b));