I'd like to create a function returning an observable with a list that I created with several observable. I think I'm very close from the solution as the debugger stop just one step before displaying the list. Here is my code: ts
this.carService.getEveryCar().subscribe((response) => {
this.cars = response;
});
service:
getEveryCar(): Observable<any> {
let cars = [];
this.getCars()
.subscribe(response => {
cars = response.list;
this.getOneMoreCar.subscribe(
response =>{
cars = response.list;
return of(cars)
})
}
return of(cars);
}
When I debug I get cars declared as empty till the end when the cars array is filled but then my ts file stop calling the service.
What can I do?