I'm using angular 7 and trying to do something in a child component : use the input property that can be at first level in the object or deeper.
My child component has this piece of code :
if (this.values.filter(obj => obj[this.matchPropertyName] === $event[i].id).length === 0) {
...
}
where this.matchPropertyName is my input (can be 'id', 'myProperty.id',...)
For a single level (obj.id) this code works. However, I need to use sometimes from a deeper level (obj.myProperty.id) and it doesn't work. How can I achieve this ?
Let me know if it not clear enough.
I'm using angular 7 and typescript 3.2.4