-
Notifications
You must be signed in to change notification settings - Fork 27.4k
feat(filterFilter): support filterFilter for object literal collection #6695
Conversation
filterFilter was previously only available to array/array-like collections, but ngRepeat supports iterating over object literals. This PR enables filtering functionality over object literal properties. Fixes #6490
Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.
If you need to make changes to your pull request, you can update the commit with Thanks again for your help! |
This is #6508 on an isolated branch |
+1 |
02dc2aa
to
fd2d6c0
Compare
cad9560
to
f294244
Compare
e8dc429
to
e83fab9
Compare
4dd5a20
to
998c61c
Compare
}; | ||
|
||
// Helper to return the specified keys of an object as a new object (for test verification) | ||
var stringifiedProps = function(obj, array) { |
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 see why you need this...
+1 |
We decided that we will not support object collections for filterFilter. In fact, it will now throw when used with an object. The suggested solution is to convert your objects to arrays; you can use a filter for that, too: https://code.angularjs.org/snapshot/docs/error/filter/notarray |
Request Type: feature
How to reproduce: Feed an object literal into an ngRepeat to loop over its properties with a filter in use, as shown here: http://plnkr.co/edit/mMvAgQgILcBVkbT2q4z4?p=preview
Component(s): misc core
Impact: small
Complexity: small
This issue is related to:
Detailed Description:
I switched the primary filterFilter iteration method to one that supports both array and object literal collections and added tests for the object version.
Other Comments:
filterFilter was previously only available to array/array-like collections,
but ngRepeat supports iterating over object literals. This PR enables
filtering functionality over object literal properties.
Fixes #6490