angular-filter
angular-filter copied to clipboard
a8m.where when collection is undefined
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; }
LGTM.
We should add isUndefined(collection)
test on line 15.
feel free to PR. thx
+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
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?