|
1 | 1 | import { RouterModule } from '@angular/router'; |
2 | 2 | import { NgModule } from '@angular/core'; |
3 | 3 |
|
4 | | -import { CommonLayoutComponent } from './layouts/common-layout/common-layout.component'; |
5 | | -import { DashboardComponent } from './pages/dashboard/dashboard.component'; |
6 | | -import { MapsComponent } from './pages/maps/maps.component'; |
7 | | -import { ChartsComponent } from './pages/charts/charts.component'; |
8 | | -import { FormsComponent } from './pages/forms/forms.component'; |
| 4 | +import { CommonLayoutComponent } from './layouts/common-layout'; |
| 5 | +import { DashboardComponent } from './pages/dashboard'; |
| 6 | +import { MapsComponent } from './pages/maps'; |
| 7 | +import { ChartsComponent } from './pages/charts'; |
| 8 | +import { FormsComponent } from './pages/forms'; |
| 9 | +import { LayoutsModule } from './layouts'; |
9 | 10 |
|
10 | 11 | @NgModule({ |
11 | | - imports: [RouterModule.forRoot( |
12 | | - [ |
13 | | - { path: '', redirectTo: 'app', pathMatch: 'full' }, |
14 | | - { path: 'app', component: CommonLayoutComponent, children: [ |
15 | | - { path: 'dashboard', component: DashboardComponent, pathMatch: 'full' }, |
16 | | - { path: 'forms', component: FormsComponent, pathMatch: 'full' }, |
17 | | - { path: 'maps', component: MapsComponent, pathMatch: 'full' }, |
18 | | - { path: 'charts', component: ChartsComponent, pathMatch: 'full' }, |
| 12 | + imports: [ |
| 13 | + RouterModule.forRoot( |
| 14 | + [ |
| 15 | + { path: '', redirectTo: 'app/dashboard', pathMatch: 'full' }, |
| 16 | + { path: 'app', component: CommonLayoutComponent, children: [ |
| 17 | + { path: 'dashboard', component: DashboardComponent, pathMatch: 'full' }, |
| 18 | + { path: 'forms', component: FormsComponent, pathMatch: 'full' }, |
| 19 | + { path: 'maps', component: MapsComponent, pathMatch: 'full' }, |
| 20 | + { path: 'charts', component: ChartsComponent, pathMatch: 'full' }, |
| 21 | + { path: '**', redirectTo: '/pages/404' }, |
| 22 | + ] }, |
| 23 | + { path: 'ui', loadChildren: './pages/ui/ui.module#UIModule' }, |
| 24 | + { path: 'pages', loadChildren: './pages/pages/pages.module#PagesModule' }, |
19 | 25 | { path: '**', redirectTo: '/pages/404' }, |
20 | | - ] }, |
21 | | - { path: 'ui', loadChildren: './pages/ui/ui.module#UIModule' }, |
22 | | - { path: 'pages', loadChildren: './pages/pages/pages.module#PagesModule' }, |
23 | | - { path: '**', redirectTo: 'pages/404' }, |
24 | | - ], |
25 | | - { useHash: true }, |
26 | | - )], |
| 26 | + ], |
| 27 | + { useHash: true }, |
| 28 | + ), |
| 29 | + LayoutsModule, |
| 30 | + ], |
27 | 31 | exports: [RouterModule], |
28 | 32 | }) |
29 | 33 | export class AppRoutingModule { } |
0 commit comments