Hi I need to filter an angular list based on a child property.
I have this model:
$scope.data = [{name:"John",type:{talent:"genius"}},
{name:"Paul",type:{talent:"genius"}},
{name:"Ringo",type:{talent:"lucky"}}];
I need to display a list of name of only talented people. So I was trying something like this:
item in data|myFilter:item.type
http://jsbin.com/ObIqUyix/1/edit
This is better because it'll let you have other properties in the type object as well and you can still filter using different properties:
item in data | filter: {type:{talent:'genius'}}:true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With