I want to filter the data from multiple array of objects like that name key according. I have a multiple array of object. Something like:
data = [
{
state: 'saass',
name: 'Saass',
type: 'sub',
icon: 'dashboard',
active: true,
children: [
{ state: 'executive', name: 'Executive Dashboard', type: 'link' },
{ state: 'sales', name: 'Sales Dashboard', type: 'link' },
{ state: 'marketing',name: 'Marketing Dashboard', type: 'link' },
{ state: 'support', name: 'Support Dashboard', type: 'link' },
{ state: 'course', name: 'Course Detail', type: 'sub_child', children: [
{ state: 'executive', name: 'Executive Dashboard', type: 'link' },
{ state: 'marketing', name: 'Marketing Dashboard', type: 'link'}
]
}
]
},
{
state: 'file-manager',
name: 'File Manager',
type: 'sub',
icon: 'dashboard',
active: false,
children: [
{ state: 'authentication', name: 'Authentication', type: 'link'},
{ state: 'database', name: 'Database', type: 'link'},
{ state: 'storage', name: 'Storage', type: 'link'}
]
}
];
In the input field I want to type the text. That text checks the data array of objects and that its according value will be show.
I need to filter the array, remove the other field that does not contain a text.
Suppose I want to search a text 's' then which name content contains the 's' keyword that keyword will be showing. For reference: https://www.gotbootstrap.com/themes/smartadmin/4.0.2/intel_analytics_dashboard.html