I need function F1() to wait for function F2() to fully execute and receive the response from a REST call in order to set some data.
Here is the code I attempted to use:
this.F1().subscribe(result => {
this.F2(result);
})
F1() {
return this.graphDataService.getAvailableSpan(a, b).subscribe(res => {
this.c = new Date(res.lastAvailableDate);
return 1;
}, error => {
this.lastAvailableDate = new Date();
return 1;
})
}