How can I filter array values using AngularJS?
Here is my scenario:
Cuisines JSON: ["food", "Alcohol","Thai"]
Categories JSON: ["home", "office","school"]
Values with cuisines and categories:
[{
"_id": "1",
"businessTypeName": "Pizza Hut",
"cus_name": ["food","Thai"],
"cat_name": ["home", "school"]
}, {
"_id": "2",
"businessTypeName": "Chicken Hut",
"cus_name":["Alcohol","Thai"],
"cat_name": ["office", "home"]
}, {
"_id": "3",
"businessTypeName": "Fish Hut",
"bussiness_url": "/dist/images/loop_image_sample_3.png",
"cus_name": ["Thai"],
"cat_name": ["office", "school"]
}]
The cuisines and categories are in checkboxes. When clicking on any checkbox, the selected values will be appended to {{selected}}.
My question is how to filter values from {{selected}}
to display in the listing_loop div.