title: Angular 2 canActivate with a promise hitting a remote service
body: <p>Firstly, I am not sure that this is the best way to handle this problem, but what I am looking for is a route guard on "/" which checks if the user is logged in, if so to redirect them to "/dashboard". I would like to do this before the route is loaded, to avoid a screen flashing since were checking auth status on a remote server. </p>
  
  <p>I am implementing the canActivate interface, but its not working as expected. It hits the auth service, and returns the user, which according to this test code should redirect the user, but instead I am seeing the user in the console but no redirect. </p>
  
  <p>Here is the code</p>
  
  <pre><code>import { Injectable }               from '@angular/core';
  import { Router, CanActivate }      from '@angular/router';
  
  import { Observable }               from 'rxjs/Observable';
  
  import { User }                     from './../../models/user.model';
  import { AuthService }              from './auth.service';
  
  @Injectable()
  export class HomeAuthGuard implements CanActivate {
    constructor(
      private router: Router,
      private authService: AuthService
    ) {}
  
    canActivate(): Promise&lt;boolean&gt; {
      return new Promise((resolve) =&gt; {
        this.authService.getStatus()
          .then(function (user: User) {
            console.log('home auth', user)
            this.router.navigate(['/dashboard']);
            resolve(false);
          })
          .catch(function () {
            resolve(true);
          });
        });
    }
  }
  </code></pre>