Skip to content

Commit 8e3991b

Browse files
fix(orderBy): ensure correct ordering with arrays of objects and no predicate
Closes angular#11866
1 parent 4374cf0 commit 8e3991b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ng/filter/orderBy.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ function orderByFilter($parse) {
241241
}
242242

243243
function objectToString(value) {
244-
if (value === null) return 'null';
245244
if (typeof value.valueOf === 'function') {
246245
value = value.valueOf();
247246
if (isPrimitive(value)) return value;
@@ -255,7 +254,9 @@ function orderByFilter($parse) {
255254

256255
function getPredicateValue(value, index) {
257256
var type = typeof value;
258-
if (type === 'string') {
257+
if (value === null) {
258+
type = 'null';
259+
} else if (type === 'string') {
259260
value = value.toLowerCase();
260261
} else if (type === 'object') {
261262
value = objectToString(value);

0 commit comments

Comments
 (0)