Skip to content

a8m.where when collection is undefined #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rodolfojnn opened this issue Feb 6, 2015 · 3 comments
Open

a8m.where when collection is undefined #87

rodolfojnn opened this issue Feb 6, 2015 · 3 comments

Comments

@rodolfojnn
Copy link

When collection is undefined on where filter, we got:

"TypeError: Cannot read property 'filter' of undefined"

A simple check solve the problem.

if(!collection)) { return false; }

@a8m
Copy link
Owner

a8m commented Feb 6, 2015

LGTM.
We should add isUndefined(collection) test on line 15.
feel free to PR. thx

@Muximize
Copy link

+1, but this needs to be implemented for all collection filters. I'm using Restangular promises in my $scope, whose collections are undefined before they get resolved. This gives me this error with isEmpty:
TypeError: Cannot read property 'length' of undefined

@HugCoder
Copy link

So, nothing actually happened on this? I'm also getting the error:
Error: collection is undefined
@http://cdnjs.cloudflare.com/ajax/libs/angular-filter/0.5.8/angular-filter.js:1278:7
...
Can't the isUndefined(collection) check just be added by the owner (@a8m) to make the implementation consistent? We need a pull request update on #88 for this?

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

No branches or pull requests

4 participants