Answer the question
In order to leave comments, you need to log in
How to collect a single entity from different APIs in Angular 8?
Hi, friend.
So the situation is this.
These entities lie in different services and are obtained through different APIs:
export interface Person { // /api/persons
id: string;
name: string;
car: string; // идентификатор car
}
export interface Car { // /api/cars
id: string;
title: string;
}
[
{"id": "ef2e65df-003a-42a8-881c-2108a0f59d75", "name": "Артур Степанович", "car": "cdec0e14-55f0-49eb-ae96-82006b95cdf2" },
{"id": "f7123c17-fee1-47b6-8391-aed83dc77565", "name": "Михаил Иванович", "car": "2ca4fa1f-7936-4717-9661-0ef773db1a14" }
]
[
{"id": "cdec0e14-55f0-49eb-ae96-82006b95cdf2", "title": "BMW X6" },
{"id": "2ca4fa1f-7936-4717-9661-0ef773db1a14", "title": "Audi A8" }
]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question