I would like to return a child element of an observable as this.
Say I have a HttpClient that gets an observable of people:
export class People{
public Name: string;
}
and a service that gets a single one as abservable:
public get(id: number): Observable<People> {
return this.http.get<People>('http://localhost:8801/' + "people/" + id);
}
Now I would like to get the name from my observable as observable:
public get(id: number): Observable<string>{
this.peopleService.get(id) .... ?
}
How could this be done?