Skip to content

Instantly share code, notes, and snippets.

@philly-vanilly
Last active May 12, 2019 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philly-vanilly/97141653e8e896dd2b7cae9a7ed9c444 to your computer and use it in GitHub Desktop.
Save philly-vanilly/97141653e8e896dd2b7cae9a7ed9c444 to your computer and use it in GitHub Desktop.
const lazyPathValue = 'lazy';
export const LAZY_PATH = new InjectionToken('LAZY_PATH');
@NgModule({
imports: [
RouterModule.forRoot(
[
{
path: '',
pathMatch: 'full',
redirectTo: lazyPathValue
},
{
path: lazyPathValue,
loadChildren: './lazy/lazy.module#LazyModule',
}
]
)
],
providers: [{ provide: LAZY_PATH, useValue: lazyPathValue }],
exports: [RouterModule]
})
export class AppRoutingModule { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment