1
I’m making a query in an API (SWAPI). The return is an object with all the information of the Star Wars characters. So far so good. But inside this object, I have some sublevels that are arrays and that besides some information, also has another URL that I need to consult to be able to print on the screen. The problem is that I’m not sure how to do this other query. To simplify, follow the return image:
That’s the get of the service:
getData(page?: string): Observable<any[]> {
if(page){
this.URL = page;
}
return this.http.get(this.URL)
.map((response: Response) => <any[]>response.json())
.catch(this.handleError);
}
I know there is a way to do with flatMap and forkJoin. I even tried, but I did not get the expected result
I followed that link: rxjs-observable
But I still couldn’t.
give a look at this link http://blog.danieleghidoli.it/2016/10/22/http-rxjs-observables-angular/
– Eduardo Vargas