title: How to run the loader until the response is fetched from the API in Ionic 4
body: <p>I am working in my Ionic 4 app and I am fetching the response from the API. I have also added the loader to the front page in which the response is coming from the API. </p>
  
  <p>I want to run the loader until the response is not fetched from the API.</p>
  
  <p>This is my <strong>tab1.page.ts</strong>:</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { ChakapiService } from './../service/chakapi.service';
  import { LoadingController, Events } from '@ionic/angular';
  import { Storage } from '@ionic/storage';
  
  @Component({
    selector: 'app-tab1',
    templateUrl: 'tab1.page.html',
    styleUrls: ['tab1.page.scss']
  })
  
  export class Tab1Page implements OnInit {
    detu: any;
    newda: any;
    constructor(public chakapi: ChakapiService, public loadingController: LoadingController, public events: Events,
      private storage: Storage) {
      this.detailsfetch('en');
    }
    ngOnInit() {
    }
    async detailsfetch($langselect) {
      const loading = await this.loadingController.create({
        message: 'Please Wait',
        duration: 2200,
        translucent: true,
      });
      await loading.present();
      this.chakapi.getdetails($langselect).subscribe(data =&gt; {
        this.detu = data;
        this.newda = this.detu.data;
      });
      return await loading.onDidDismiss();
    }
  }
  </code></pre>
  
  <p>In this I am fetching the response from the API and I have added the loader but the loader is running for a defined time. </p>
  
  <p>I want to run the loader until the response is not fetched from the API.</p>
  
  <p>Any help is much appreciated.</p>