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

fix(orderBy): sort by identity if no predicate is given #9403

Closed

Conversation

petebacondarwin
Copy link
Contributor

This implementation handles all the various corner cases more consistently.

Closes #5847
Closes #4579

@@ -125,6 +128,12 @@ function orderByFilter($parse){
descending = predicate.charAt(0) == '-';
predicate = predicate.substring(1);
}
if ( predicate === '' ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no spaces

@IgorMinar
Copy link
Contributor

lgtm

@@ -125,6 +128,12 @@ function orderByFilter($parse){
descending = predicate.charAt(0) == '-';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason why == instead of === ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

orderBy filter doesn't support sorting by the value itself
4 participants