title: Show loading for multiple requests in Ionic 3 and Angular 4
body: <p>How can I display a loading on the screen for the entire time of my two requests?</p>
  
  <p>I tried to put the call pro loading, in both requests. But when the fastest request is finalized, it hides the loading, even if the other request is in progress.</p>
  
  <pre><code>ionViewDidLoad() {
    this.getSummary(parametros);
    this.getHeatmap(parametros);
  }
  
  getSummary() {
    this.loadingService.showLoader(this.constants.MSG_LOADING);
  
    this.remedyProvider.getSummaryByDate().subscribe(
      (response) =&gt; {
       /// do something
      }, (error) =&gt; {
        this.showSummary = false;
        console.log(`Backend returned error was: ${error}`);
        this.loadingService.hideLoader();
      }, () =&gt; {
        console.log('get heatmap complete');
        this.loadingService.hideLoader();
      }););
  }
  
  getHeatmap() {
    this.loadingService.showLoader(this.constants.MSG_LOADING);
  
    this.remedyProvider.getHeatmap().subscribe(
      (response) =&gt; {
          //do something      
      }, (error) =&gt; {
        console.log(`Backend returned error was: ${error}`);
  
      }, () =&gt; {
        console.log('get heatmap complete');
        this.loadingService.hideLoader();
      });
  }
  </code></pre>
  
  <p>Code of <strong>LoadingProvider</strong> (loadginService):</p>
  
  <pre><code>export class LoadingProvider {
  
    loader: any = null;
    constructor(private _loadingController: LoadingController) {
    }
  
    private showLoadingHandler(message) {
        if (this.loader == null) {
            this.loader = this._loadingController.create({
                content: message
            });
            this.loader.present();
        } else {
            this.loader.data.content = message;
        }
    }
  
    private hideLoadingHandler() {
        if (this.loader != null) {
            this.loader.dismiss();
            this.loader = null;
        }
    }
  
    public showLoader(message) {
        this.showLoadingHandler(message);
    }
  
    public hideLoader() {
        this.hideLoadingHandler();
    }
  }
  </code></pre>