Click here to Skip to main content
15,564,399 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Everyone,

Can someone tell me how to retrieve data after filtering the collection based on not null check on a property.

I am able to filter the data based on null check
vm.sampledata= $filter('filter')(vm.data.list, { dueBy: null }, true);

but unable to filter the data with not null check on list

vm.sampledata= $filter('filter')(vm.data.list, { dueBy>: !null }, true);
which is not working

Thanks.

What I have tried:

vm.sampledata= $filter('filter')(vm.data.list, { dueBy: !null }, true);
Posted
Updated 24-Jul-17 22:28pm

1 solution

You can use from the below examples actually it may vary for the angular version,but i think '' will work for all major versions.

vm.sampledata= $filter('filter')(vm.data.list, { dueBy: '' }, true);


vm.sampledata= $filter('filter')(vm.data.list, { dueBy: !null }, true);


vm.sampledata= $filter('filter')(vm.data.list, { dueBy: !! }, true);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900