diff options
Diffstat (limited to 'src/ng')
| -rw-r--r-- | src/ng/filter/orderBy.js | 6 |
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)); |
