title: Angular 4 Lazy Load Module with canLoad or canActivate guard direct url/
body: <p>I have tried using canActivate and canLoad in two different module levels, and I am still unable to directly access the lazy loaded module.</p>
  
  <p>In app.routing.module.ts</p>
  
  <pre><code>   import { AuthGuardImpl } from './lazy-load/auth-guard.service';
  import {AuthGuard} from './lazy-load/auth.service';
  
  
  const routes: Routes = [
    { path: 'home', component: HomeComponent },
    { path: '', redirectTo: 'home', pathMatch: 'full' },
    { path: 'lazy', canLoad: [AuthGuardImpl], loadChildren: 'app/lazy-load/lazy-load.module#LazyLoadModule'},
    { path: '**', component: PageNotFoundComponent }
  ];
  
  @NgModule({
    imports: [
      CommonModule,
      RouterModule.forRoot(routes)
    ],
    exports: [RouterModule],
    declarations: [],
    providers: [AuthGuardImpl, AuthGuardService]
  })
  </code></pre>
  
  <p>Where the above code works if you don't navigate to <code>http://url.com/lazy</code> directly. But go to <code>http://url.com/</code> then follow a router link to the lazy module.</p>
  
  <p>Similarly I tried:</p>
  
  <pre><code>import { AuthGuard } from './auth.service';
  import { AuthGuardImpl } from './auth-guard.service';
  
  
  const lazyRoutes: Routes = [
    { path: '', component: LazyLoadComponent, canActivate: [AuthGuardImpl],
      children: [
      { path: 'dashboard',  loadChildren: 'app/lazy-load/dashboard/dashboard.module#DashboardModule' },
      { path: '', redirectTo: 'dashboard', pathMatch: 'full'},
  ];
  
  @NgModule({
    imports: [
      CommonModule,
      RouterModule.forChild(lazyRoutes)],
    exports: [RouterModule],
    declarations: [],
    providers: [AuthGuardImpl, AuthGuard]
  })
  </code></pre>
  
  <p>Which again, does not work going directly to <code>http://url.com/lazy</code>, but will work if the app loads, and then the user navigates to <code>/lazy</code> by routerlink.</p>
  
  <p>Is it possible to navigate to a direct url for a lazy loaded module that uses a guard?</p>