title: How to create loader once and use it all over the app? - Ionic 3
body: <p>Everywhere in the blogs &amp; article loader is created in the components. I need to create a loader once and use it all over the app. But the problem is, in ionic 3, we can't dismiss loader manually. It should be dismissed after it has presented such as below correct code:</p>
  
  <pre><code>ionViewLoaded() {
    let loader = this.loading.create({
      content: 'Getting latest entries...',
    });
  
    loader.present().then(() =&gt; {
      this.someService.getLatestEntries()
        .subscribe(res =&gt; {
          this.latestEntries = res;
        });
      loader.dismiss();
    });
  }
  </code></pre>
  
  <p>I tried creating loader once using service and use it whenever I wanted all over app. such as follows:</p>
  
  <pre><code>import {Injectable} from '@angular/core';
  import { LoadingController } from 'ionic-angular';
  
  @Injectable()
  export class BasicService{
      loader: any;    
      constructor(public loadingCtrl: LoadingController){
        //creates loader once so there is less data redundancy
          this.loader = this.loadingCtrl.create({
              content: `loading...`,
          });
  
      }
      showLoader() { //call this fn to show loader
          this.loader.present();    
      }
      hideLoader() { //call this fn to hide loader
          this.loader.dismiss();
      }
  }
  </code></pre>
  
  <p>But it doesn't work, gives an error such as.</p>
  
  <blockquote>
    <p>Runtime Error Uncaught (in promise): removeView was not found</p>
  </blockquote>
  
  <p>So is there any way where can achieve this feat in ionic 3, which can help me with data redundancy?</p>