Kind of beginner question here: in an Ionic2 component, I have 2 different service calls using Observables:
getTimelineEvents() {
this.receiptsEventsRequestState = RequestState.Pending;
this.chargesEventsRequestState = RequestState.Pending;
this.miscService.getCustomerReceiptsEvents()
.subscribe(
(events: TimelineEvent[]) => {
this.receiptsEventsRequestState = RequestState.Success;
this.receiptsEvents = events;
},
);
this.miscService.getCustomerChargesEvents()
.subscribe(
(events: TimelineEvent[]) => {
this.chargesEventsRequestState = RequestState.Success;}
this.chargesEvents = events;
);
}
I'd like to know when both getCustomerReceiptsEvents
and getCustomerChargesEvents
are successful sothat I can call another method (this method needs chargesEvents and receiptsEvents data).
Thanks.