-
Notifications
You must be signed in to change notification settings - Fork 27.3k
feat(filter): orderBy for object collections #6337
Conversation
Allows to use orderBy filter on collection objects and not only arrays. Closes: angular#6210
|
CLA should be ok now hopefully. |
|
CLA signature verified! Thank you! Someone from the team will now triage your PR and it will be processed based on the determined priority (doc updates and fixes with tests are prioritized over other changes). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really like that we're losing object keys with this, I dunno. It basically transforms the object into an array, and it's impossible to sort by the key of the object (which would be a cool trick, even for arrays)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but hmm, maybe it doesn't matter that much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand your point about that but to keep the key, we would have to return a different structure like [{key: 'userName', value: {/* an object*/}}, ...] which is an even worse solution I believe. If the keys are important though, and maybe even sorting the keys, I think the best way is to first create an array of the keys then iterate on the keys.
|
If support for objects released soon? |
|
I have created a module that provides the |
02dc2aa to
fd2d6c0
Compare
cad9560 to
f294244
Compare
8292c21 to
7b9fddf
Compare
4dd5a20 to
998c61c
Compare
|
I think we can close this, based on #11255 |
Allows to use orderBy filter on collection objects and not only arrays.
eg:
Closes: #6210