title: Getting Nav through ViewChild in Ionic 2 Beta
body: <p>They just updated Ionic 2 to use Angular 2 RC1, which is great except the routing is still a little strange to me. I was trying to follow along with the update guide, but my nav is still undefined here. The old getComponent method worked, but they got rid of that with this update. It works within a component or a page, but not within a service.</p>
  
  <p>Error I'm getting is <code>No provider for NavController!</code></p>
  
  <pre><code>import {IonicApp, NavController, Nav} from 'ionic-angular';
  import {Injectable, ViewChild} from '@angular/core';
  import {Http, HTTP_PROVIDERS, Headers} from '@angular/http';
  import {HomePage} from '../pages/home/home';
  
  @Injectable()
  export class User {
    isLoggedIn: boolean = false;
    username: string = 'jaruesink';
    constructor (public nav: NavController) {
    }
    login(username) {
      this.isLoggedIn = true;
      this.username = username;
      this.nav.push(HomePage);
    }
    logout() {
      this.isLoggedIn = false;
    }
  }
  </code></pre>