0

How can I do multiple http requests, so for this scenario how can I do another request budgetService.getData() after the getBudgetDays() requests completes?

this.budgetService.getBudgetDays(this.startDate, this.finishDate).pipe(
  catchError(res => this.budgetTestService.getBudgetDates(this.startDate, this.finishDate)),
).subscribe(res => {
  // res = value of getBudgetDays if no error, or getBudgetDates if there is one
});
4
  • This should be already answered in any of the links above. If it doesn't let me know and I'll reopen question. Commented Feb 18, 2019 at 11:32
  • some answers use switchMap, concatMap, mergeMap. Which one should I use? Commented Feb 18, 2019 at 11:35
  • It depends on what you want to do. Probably concatMap or mergeMap I guess. Commented Feb 18, 2019 at 11:38
  • Also have a look here stackoverflow.com/questions/53153902/… for what's the difference Commented Feb 18, 2019 at 12:01

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.