The question is how to make it so that when performing such a function

this._activityService.getActivityAnalyticsCount(this.token, params) .map(result => result.json()) .subscribe( data => { console.log(data); }, err => console.log(err) ); 

I could wait for a response from the server and stop the execution of the remaining asynchronous methods.

Just the essence is - I make a request and until the answer has passed, the rest of the functions do not start. How to implement it?

  • unsubscribe () is not an option? - Jamshed

1 answer 1

move other asynchronous methods to .subscribe ().