I am looking to search a list of complex objects.
Here is an example of how my list is structured:
private employees: Employee[] = [
{
name: 'Mary Jay',
departmentsList: [1, 2, 3], //these are the IDs of departments from the list below
emailList: [ '<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bbded6cb8afbdcdad6d2d795d8d4d6">[email protected]</a>', '<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cfaaa2bffd8fa8a2aea6a3e1aca0a2">[email protected]</a>', '<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a5c0c8d596e5c2c8c4ccc98bc6cac8">[email protected]</a>' ]
}
];
private departments: Department[] = [
{ id: 1, name: 'dep1' },
{ id: 2, name: 'dep2' },
{ id: 3, name: 'dep3' },
{ id: 4, name: 'dep4' },
{ id: 5, name: 'dep5' },
{ id: 6, name: 'dep6' }
];
My goal is to create a search filter based on department names and emails.
Does anyone have any suggestions on how I can extract department names by iterating through this list of complex objects? This would allow me to search through the lists of emails and departments using their names.
Thank you!