angular-filter icon indicating copy to clipboard operation
angular-filter copied to clipboard

a8m.where when collection is undefined

Open rodolfojnn opened this issue 9 years ago • 3 comments

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; }

rodolfojnn avatar Feb 06 '15 13:02 rodolfojnn

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

a8m avatar Feb 06 '15 13:02 a8m

+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

Muximize avatar Aug 11 '15 13:08 Muximize

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?

HugCoder avatar Mar 16 '16 11:03 HugCoder