For example, I have a list like this, and I wanna search for objects which have the child "apple", is it doable?
[{id: 1, child:["apple", "tomato", "potato"]}, {id: 1, child:["potato"]}, ...]
For example, I have a list like this, and I wanna search for objects which have the child "apple", is it doable?
[{id: 1, child:["apple", "tomato", "potato"]}, {id: 1, child:["potato"]}, ...]
That's just basic Javascript ... You should be able to do it yourself. Otherwise, you should learn Javascript instead of Angular.
Nevertheless, use the according tags.
And here is your answer.
const apples = data.filter(item => item.child.includes('apple'));