I have the following Structure:
export class Contact {
id: number = 0;
firstname: string = '';
lastname: string = '';
phones: Phone[] = [];
emails: Email[] = [];
}
export class Email {
id: number = 0;
emailType: string = '';
address: string = '';
}
export class Phone {
id: number = 0;
phoneType: string = '';
number: string = '';
}
Now in a component I have an array of Contact named contacts and a phone object.
I want to remove that phone object which is in a phones array of a contact which is inside of a contacts array.
Is there a simple way like filter or something that can do this easily without going through all contacts with a loop?