app.module.ts
2.52 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AppComponent } from './app.component';
import { ViplistComponent } from './viplist/viplist.component';
import {AlertModule} from 'ng2-bootstrap';
import {MoyaRestModule} from 'moya-angular-common';
import { RouterModule, Routes } from '@angular/router';
import { OldMoyaComponent } from './old-moya/old-moya.component';
import {SafePipe } from './pipes/safe.pipe';
import { I18nDirective } from './directives/i18n.directive';
import {TestComponent} from './test/test.component';
import { AdminMenuComponent } from './menu/admin-menu/admin-menu.component';
import {TopMenuComponent} from './menu/top-menu/top-menu.component';
import {LeftMenuComponent} from './menu/left-menu/left-menu.component';
import { InfoMenuComponent } from './menu/info-menu/info-menu.component';
import { UserMenuComponent } from './menu/user-menu/user-menu.component';
import { UserComponent } from './user/user.component';
import { InfoComponent } from './info/info.component';
import { AdminComponent } from './admin/admin.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: 'admin',
children: [
{ path: '', component: AdminMenuComponent, outlet: 'left-menu' },
{ path: '', pathMatch: 'full', component: AdminComponent },
{ path: 'old', component: OldMoyaComponent },
]
},
{ path: 'old', pathMatch: 'prefix', component: OldMoyaComponent },
];
@NgModule({
declarations: [
AppComponent,
ViplistComponent,
OldMoyaComponent,
SafePipe,
I18nDirective,
TestComponent,
TopMenuComponent,
LeftMenuComponent,
AdminMenuComponent,
InfoMenuComponent,
UserMenuComponent,
UserComponent,
InfoComponent,
AdminComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
AlertModule.forRoot(),
MoyaRestModule.forRoot() ,
RouterModule.forRoot(appRoutes)
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }