I'm trying to use more than one REST endpoint call in my angular 2 component. The problem is, that I'm not getting any data from no one of them. What I do is this:
getData() {
myService.getDataA().subscribe(data => { this.dataA = data })
myService.getDataB().subscribe(data => { this.dataB = data })
myService.getDataC().subscribe(data => { this.dataC = data })
And my service is:
getDataA() {
return this.http.get(MY_URL).map(data => data.json());
getDataB() {
return this.http.get(MY_URLB).map(data => data.json());
getDataC() {
return this.http.get(MY_URLC).map(data => data.json());
Is there a way how to wait untill all async task are completed and then show the template?
Thank you