Skip to content

Instantly share code, notes, and snippets.

@whisher
Created August 18, 2018 14:47
Show Gist options
  • Save whisher/edce490770ad72e59acfcb41c4a3886a to your computer and use it in GitHub Desktop.
Save whisher/edce490770ad72e59acfcb41c4a3886a to your computer and use it in GitHub Desktop.
Questo e app-routing
const routes: Routes = [
{ path: '', loadChildren: './features/blog/blog.module#BlogModule', data: { preload: false , animation: {page: 'home'}} },
{ path: 'admin', loadChildren: './features/admin/admin.module#AdminModule', data: { preload: false, animation: {page: 'dashboard'} } },
{ path: 'auth', loadChildren: './features/authentication/authentication.module#AuthenticationModule', data: { preload: false, animation: {page: 'login'} } },
{ path: '**', redirectTo: '', pathMatch: 'full' }
];
@NgModule({
providers: [ AppPreloadingStrategy ],
imports: [ RouterModule.forRoot(routes, { preloadingStrategy: AppPreloadingStrategy }) ],
exports: [ RouterModule ]
})
export class AppRoutingModule { }
Questo e il blog-routing
export const ROUTES: Routes = [
{
path: '', component: BlogLayoutMainComponent,
children: [
{
path: '',
pathMatch: 'full',
redirectTo: 'home'
},
{
path: 'home',
loadChildren: './home/home.module#BlogHomeModule'
}
]
}
];
@NgModule({
imports: [
RouterModule.forChild(ROUTES)
],
exports: [RouterModule]
})
export class BlogRoutingModule { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment