I have a need for a similar filter logic as the fiddler on this post Older post, but for a newer version of Angular.
The Fiddler example on this older post, seems to work exactly how I would like mine to work with the nested JSON objects (4 levels deep).. I am just at a lost of how to do the same with in my Anuglar 8 solution.
My data structure, looks like the following:
[{
"name": "Repair Category Name",
"image": "https://via.placeholder.com/150",
"subCategories": [
{
"name": "Repair SubCategory Name 1",
"image": "https://via.placeholder.com/150",
"selectorOptions": [
{
"name": "Repair Selector Option 1",
"image": "https://via.placeholder.com/150",
"repairItems": [
{
"name": "Repair Item 1",
"image": "https://via.placeholder.com/150",
"sorCode": "12345"
},
{
"name": "Repair Item 2",
"image": "https://via.placeholder.com/150",
"sorCode": "12345"
}
]
}
]
},
{
"name": "Repair SubCategory Name 2",
"image": "https://via.placeholder.com/150",
"selectorOptions": [
{
"name": "Repair Selector Option 1",
"image": "https://via.placeholder.com/150",
"repairItems": [
{
"name": "Repair Item 1",
"image": "https://via.placeholder.com/150",
"sorCode": "12345"
},
{
"name": "Repair Item 2",
"image": "https://via.placeholder.com/150",
"sorCode": "12345"
}
]
}
]
}
]}]
I would like to be able to filter by the name of the RepairItem OR its SOR Code, but also return the full Sub and Parent objects so I can show the results under there parent/sub category etc on the UI.
Here is what I have tried so far: Stackblitz
Any help would be greatly appreciated!
Thanks