title: Ionic 2 - ionViewDidLoad function cant read navCtrl
body: <p>I am using localForage to store local data in my app. So I check when screen is loaded <code>if value = true</code> when it is the page has to be redirected to my TabsPage.</p>
  
  <p>Here is the constructor:</p>
  
  <pre><code> constructor(public navCtrl: NavController, public loading: LoadingController){}
  </code></pre>
  
  <p>Here is my ionViewLoaded function: </p>
  
  <pre><code>ionViewDidLoad() {
    localForage.getItem('didLogin', function(err, value) {
       // Run this code once the value has been
       // loaded from the offline store.
       console.log(value);
  
       if(value){
          this.navCtrl.push(TabsPage);
       }
    });
  }
  </code></pre>
  
  <p>In an other function it is working with the same code line.</p>
  
  <p>This is the error which I get: </p>
  
  <p><code>ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'navCtrl' of undefined
  TypeError: Cannot read property 'navCtrl' of undefined</code></p>