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

feat(filterFilter): support filterFilter for object literal collection #6695

Closed
wants to merge 1 commit into from
Closed

feat(filterFilter): support filterFilter for object literal collection #6695

wants to merge 1 commit into from

Conversation

quantizor
Copy link

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

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
@mary-poppins
Copy link

Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.

  • Uses the issue template (#6695)

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

@quantizor
Copy link
Author

This is #6508 on an isolated branch

@MigFerreira
Copy link

+1

};

// Helper to return the specified keys of an object as a new object (for test verification)
var stringifiedProps = function(obj, array) {
Copy link
Member

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...

@thiago-negri
Copy link

+1

@Narretz
Copy link
Contributor

Narretz commented Jun 5, 2015

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

@Narretz Narretz closed this Jun 5, 2015
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.

Implement filtering on object-based ng-repeat
8 participants