title: How to access parent navController ionic 2
body: <p>I'm learning Ionic 2 by building a simple app, but I've ran into a problem I can't solve.</p>
  
  <p>The app has a ion-nav for the login page, after logging in it goes into a tabs navigator. So the app nav would be something like:</p>
  
  <pre><code>app&lt;Nav&gt; {
      LoginPage,
      restrictedTabs&lt;Nav&gt; {
          Page1,
          ...
      }
  }
  </code></pre>
  
  <p>My problem is I don't know how to access appNav while I'm inside Page1, so that I can, for example, logout the user and block him from "restrictedTabs".</p>
  
  <p>I've tried as the docs say with @ViewChild</p>
  
  <pre class="lang-js prettyprint-override"><code>import {Component, ViewChild} from '@angular/core';
  import {NavController} from 'ionic-angular';
  
  @Component({
    templateUrl: 'page1url...'
  })
  export class ProfilePage {
      @ViewChild('appNav') appNav : NavController
  
      constructor(private _nav: NavController) {
  
      }
  
      pushNewPlace() {
          console.log(this._nav.rootNav);
          console.log(this._nav.parent);
      }
  
      ngAfterViewInit() {
        console.log(this.appNav);
      }
  }
  </code></pre>
  
  <p>But appNav is always undefined, as is rootNav (which I've seen in some tutorial...). If I try @ViewChild('appNav') on LoginPage controller it works good</p>