Lets say I want to make 2 http calls which returns data and I want to call a function only after both the http calls have returned data so I can merge both the data.
ngOnInit(): void {
this.getData();
}
getData() {
this.func1();
this.func2();
this.func3();
}
async func1() {
this.service.call1().subscribe((data) => {
this.data1 = data;
});
}
async func2() {
this.service.call2().subscribe((data) => {
this.data2 = data;
});
}
func3() {
//this should only get called when func1 and func2 have finished their http calls.
}