I have 5 api calls in a page. some apis take 20 sec to give response. some take 30 sec to give response. some take 10 sec so, when first api gives its response, first api sets l
Another way to achieve this if you don't want to use forkJoin or want to control each one individually, you can create a Subscription variable for each API call, and then in your HTML use an *ngIf="sub1 || sub2 || ... || sub5" to display and hide the loading indicator, it will be something like this:
//declare subscriptions like so
sub1: Subscription;
ngInit() {
sub1 = this.api1();
sub2 = this.api2();
sub3 = this.api3();
sub4 = this.api4();
sub5 = this.api5();
}
in your HTML loading bar tag add:
*ngIf="sub1 || sub2 || sub3 || sub4 || sub5"