Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit a9ea309

Browse files
committed
Revert "fix(orderBy) and nit fixes"
This reverts commit f01a643.
1 parent e21d83c commit a9ea309

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

src/ng/filter/orderBy.js

-7
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ function orderByFilter($parse){
122122
sortPredicate = isArray(sortPredicate) ? sortPredicate: [sortPredicate];
123123
if (sortPredicate.length === 0) { sortPredicate = ['+']; }
124124
sortPredicate = sortPredicate.map(function(predicate){
125-
predicate = predicate || '';
126125
var descending = false, get = predicate || identity;
127126
if (isString(predicate)) {
128127
if ((predicate.charAt(0) == '+' || predicate.charAt(0) == '-')) {
@@ -131,12 +130,6 @@ function orderByFilter($parse){
131130
}
132131
if (predicate === '') {
133132
// Effectively no predicate was passed so we compare identity
134-
if (array.some(angular.isObject)) {
135-
return function () {
136-
return descending ? 1 : 0;
137-
};
138-
}
139-
140133
return reverseComparator(function(a, b) {
141134
return compare(a, b);
142135
}, descending);

test/ng/filter/orderBySpec.js

-14
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,6 @@ describe('Filter: orderBy', function() {
9191
.toEqualData([{"원": 31000}, {"원": 76000}, {"원": 156000}]);
9292
});
9393

94-
it('should maintain order in an array of objects when no predicate is provided', function() {
95-
var array = [{a: 1}, {b: 2}, {c: 3}];
96-
97-
expect(orderBy(array)).toEqualData(array);
98-
expect(orderBy(array, '')).toEqualData(array);
99-
expect(orderBy(array, [])).toEqualData(array);
100-
expect(orderBy(array, [''])).toEqualData(array);
101-
expect(orderBy(array, ['+'])).toEqualData(array);
102-
});
103-
104-
it('should inverse order in an array of objects when minus is provided without predicate', function() {
105-
expect(orderBy([{a: 1}, {b: 2}, {c: 3}], ['-'])).toEqualData([{c: 3}, {b: 2}, {a: 1}]);
106-
});
107-
10894
it('should throw if quoted string predicate is quoted incorrectly', function() {
10995
/*jshint -W008 */
11096
expect(function() {

0 commit comments

Comments
 (0)