title: Cannot call the provider method on rootpage ionic 2
body: <p>I have a provider called GlobalService.
  In the GlobalService I have made a method called <code>load</code>:</p>
  
  <pre><code>load() {
      if (this.data) {
        // already loaded data
        return Promise.resolve(this.data);
      }
  
      // don't have the data yet
      return new Promise(resolve =&gt; {
        // We're using Angular Http provider to request the data,
        // then on the response it'll map the JSON data to a parsed JS object.
        // Next we process the data and resolve the promise with the new data.
        this.http.get('https://randomuser.me/api/?results=10')
          .map(res =&gt; res.json())
          .subscribe(data =&gt; {
            // we've got back the raw data, now generate the core schedule data
            // and save the data for later reference
            this.data = data;
            resolve(this.data);
          });
      });
    }
  </code></pre>
  
  <p>I am calling the method on event "onPageDidEnter" like this.</p>
  
  <pre><code>this.globalService.load().then(data=&gt;{
     console.log(data);
  });
  </code></pre>
  
  <p>When I run,there is a message </p>
  
  <blockquote>
    <p>typeError: Cannot read property 'load' of undefined</p>
  </blockquote>
  
  <p>This is the complete code of my rootpage:</p>
  
  <pre><code>import { Component, Type, OnInit } from '@angular/core';
  import { NavController, Page } from 'ionic-angular';
  // import {InAppBrowser, InAppBrowserRef} from 'ionic-native';
  import { Http, Headers } from '@angular/http';
  import 'rxjs/add/operator/map';
  
  import { CariPesawatPage } from '../cari-pesawat/cari-pesawat';
  import { CariHotelPage } from '../cari-hotel/cari-hotel';
  import { CariKeretaPage } from '../cari-kereta/cari-kereta';
  import { KonfirmasiPembayaranCreditCardPage } from '../konfirmasi-pembayaran-credit-card/konfirmasi-pembayaran-credit-card';
  import { CariTourPage } from '../cari-tour/cari-tour';
  
  import {GlobalService} from '../../providers/global-service/global-service';
  import {PesawatService} from '../../providers/pesawat-service/pesawat-service';
  
  @Component({
    templateUrl: 'build/pages/cari-tiket/cari-tiket.html',
    providers:[GlobalService, PesawatService]
  })
  
  export class CariTiket {
      static get parameters(){
          return [[NavController]];
    }
  
    onPageWillEnter() {
      console.log("Showing the first page!");
    }
  
      private pesawatPage: any;
      private hotelPage: any;
      private keretaPage: any;
      private tourPage: any;
  
      constructor(private navController: NavController, public globalService:GlobalService, public pesawatService:PesawatService, public http:Http) {
      // this.pesawatPage = KonfirmasiPembayaranCreditCardPage;
          this.pesawatPage = CariPesawatPage;
          this.hotelPage = CariHotelPage;
          this.keretaPage = CariKeretaPage;
          this.tourPage = CariTourPage;
          // this.pesawatService.loadAirlines().then(data =&gt; {
              // console.log(data);
          // });
      }
  
      onPageDidEnter (){
          this.globalService.load().then(data=&gt;{
           console.log(data);
          });
      }
    openPage(page){
      //let browser: InAppBrowserRef = InAppBrowser.open('https://google.com', '_self', 'location=no');
      //browser.show();
      //browser.close();
  
      this.navController.push(page,null,{
        animate:true,
      });
    }
  }
  </code></pre>
  
  <p>hope some one help me.</p>
  
  <p>thanks.</p>