We have 2 arrays speisekarte (10 objects) and essensplan (8 objects)
const speisekarte = [
{ id: 11, name: 'Kabeljaufilet', preis: 3.55, art: 'mit Fisch' },
{ id: 12, name: 'Spaghetti Bolognese', preis: 3.85, art: 'mit Fleisch' },
const essensplan = [
{ id: 1, essenProWoche: [11, 12] },
I want essensplan to call the ID's from speisekarte and print out the details of it. At the moment, my web page looks like this:
- 1, 11, 12
How do implement the details by just using the ID's.
I already have a method for "EssenID" for the detail page of one object but I dont know, how to use it for this type of array.
/** GET essen by ID. Will 404 if id not found */
getEssen(id: number): Observable<Essen> {
const url = `${this.speisekarteUrl}/${id}`;
return this.http.get<Essen>(url).pipe(
tap(_ => this.log(`fetched essen id=${id}`)),
catchError(this.handleError<Essen>(`getEssen id=${id}`))
);
}
this.http.getfor eachidfromessenProWoche?