Sorry if this question has already been asked; I couldn't find the solution.
Here is my issue:
In my Angular app, I am retrieving a complex JSON object from a web service. I then present this JSON object to the user in tree format using ngx json viewer.
Considering that the tree is extensive and intricate, I would like to allow users to filter which fields they see in the view.
I've been struggling to determine how to filter the fields from the JSON based on the filter text entered in the input box. While I know it's possible to query and filter for specific field values, I haven't come across a way to filter based on the field names themselves.
For example, if I have this JSON:
{
"firstname": "John",
"lastname": "Smith",
"phone": "999-999-9999",
"address": "123 Main St"
}
And the user types in "name" as the filter text, I want to display only the matching fields:
{
"firstname": "John",
"lastname": "Smith"
}
Does this concept make sense? Is it feasible?
Thanks for your help!