|
import { NgModule } from '@angular/core'; |
|
import { RouterModule, Routes } from '@angular/router'; |
|
|
|
import { DefaultLayoutComponent } from './containers'; |
|
|
|
const routes: Routes = [ |
|
{ |
|
path: '', |
|
redirectTo: 'dashboard', |
|
pathMatch: 'full' |
|
}, |
|
{ |
|
path: '', |
|
component: DefaultLayoutComponent, |
|
data: { |
|
title: 'Home' |
|
}, |
|
children: [ |
|
{ |
|
path: 'dashboard', |
|
loadChildren: () => |
|
import('./views/dashboard/dashboard.module').then((m) => m.DashboardModule) |
|
}, |
|
{ |
|
path: 'about', |
|
loadChildren: () => |
|
import('./views/about/about.module').then((m) => m.AboutModule) |
|
}, |
|
] |
|
}, |
|
|
|
{path: '**', redirectTo: 'dashboard'} |
|
]; |
|
|
|
@NgModule({ |
|
imports: [ |
|
RouterModule.forRoot(routes, { |
|
scrollPositionRestoration: 'top', |
|
anchorScrolling: 'enabled', |
|
initialNavigation: 'enabledBlocking' |
|
|
|
}) |
|
], |
|
exports: [RouterModule] |
|
}) |
|
export class AppRoutingModule { |
|
} |
|
|