app-routing.module.ts
1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { Routes, RouterModule } from '@angular/router';
import { LoginComponent } from './pages/login/login.component';
import { InfoComponent } from './pages/info/info.component';
/* const appRoutes: Routes = [
{
path: 'user',
children: [
{path: '', component: UserMenuComponent, outlet: 'left-menu'},
{path: '', pathMatch: 'full', component: UserComponent},
{path: 'old', component: OldMoyaComponent},
]
},
{
path: 'info',
children: [
{path: '', component: InfoMenuComponent, outlet: 'left-menu'},
{path: '', pathMatch: 'full', component: OldMoyaComponent},
{path: 'old', component: OldMoyaComponent},
{path: 'viplist', component: ViplistComponent},
]
},
{
path: 'admin',
children: [
{path: '', component: AdminMenuComponent, outlet: 'left-menu'},
{path: '', pathMatch: 'full', component: AdminComponent},
{path: 'old', component: OldMoyaComponent},
]
},
{path: 'old', pathMatch: 'prefix', component: OldMoyaComponent},
]; */
const APP_ROUTES: Routes = [
{ path: 'info', loadChildren: 'app/pages/info/info.module#InfoModule' },
{ path: 'admin', loadChildren: 'app/pages/admin/admin.module#AdminModule' },
{ path: 'user', loadChildren: 'app/pages/user/user.module#UserModule' },
{ path: 'login', component: LoginComponent },
{ path: '', pathMatch: 'full', redirectTo: 'login' },
{ path: '**', component: LoginComponent }
];
@NgModule({
imports: [
RouterModule.forRoot(
APP_ROUTES,
/* {
enableTracing: true, // <-- debugging purposes only
} */
)
],
exports: [
RouterModule
],
providers: [
]
})
export class AppRoutingModule { }