getContactsByCategory(category: string): Observable<Contact[]> {
return this.getContacts().pipe(map(contacts => contacts.filter(contact => contact.category == category)));
}
getContactById(id: number): Observable<Contact> {
return this.getContacts().pipe(map(contacts
=> contacts.find(contact
=> contact.id == id)));
}