title: Angular 2 conditional redirect of homepage
body: <p>I made a guard to conditionally redirect from the homepage, in the app.routing.ts:</p>
  
  <pre><code>{ path: '', redirectTo: '/dashboard', pathMatch: 'full', canActivate: [HomePageGuard] }
  </code></pre>
  
  <p>My guard looks something like this:</p>
  
  <pre><code>canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
  if(condition){
    return true;
  } else {
    this.router.navigate(['/info']);
    return false;
  }
  }
  </code></pre>
  
  <p>Now for every other path, this works great. But for</p>
  
  <pre><code>{ path: '', redirectTo: '/dashboard', pathMatch: 'full'}
  </code></pre>
  
  <p>The guard doesn't seem to do anything, it always redirects to /dashboard, no matter what the guard returns.
  I don't want to put the guard into the /dashboard path, because this path should still be available for everyone, just not as the start page...</p>
  
  <p>Any help would be greatly appreciated</p>
  
  <p>edit:
  How i solved it for now:</p>
  
  <pre><code>{ path: '', component: HomePageComponent, canActivate: [HomePageGuard] }
  </code></pre>
  
  <p>(note that the HomePageComponent is empty, since it gets redirected in the [HomePageGuard] either way)</p>
  
  <pre><code>  canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
  if(condition){
    this.router.navigate(['/dashboard']);
    return false;
  } else {
    this.router.navigate(['/start']);
    return false;
  }
  }
  </code></pre>