I have multiple http get calls (*one listed below which works
asynchronously*) an*d i want them to be synchronous not async*. So that
the output of one can be used in another and so on
*Caller*
this._myGroupService.getGroupsNameJSON()
.subscribe(data => {
console.log("JSON.stringify(data));
});
*Called*
getGroupsNameJSON() {
let header = new Headers();
header.append("Content-Type", "application/json; odata=verbose");
header.append("Accept", "application/json; odata=verbose");
return this.http.get(this._url, {
headers: header
}).map(this.extractData)
}
private extractData(res: Response) {
let body = JSON.stringify(res.json());
return body || {};
}
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.