@@ -4,20 +4,29 @@ import { FormsModule } from '@angular/forms';
4
4
import { HttpModule } from '@angular/http' ;
5
5
import { MatToolbarModule } from '@angular/material/toolbar' ;
6
6
import { MatIconModule } from "@angular/material/icon" ;
7
- // import { Ng5Module } from './ng5.module';
8
- import { BrowserAnimationsModule } from '@angular/platform-browser/animations' ;
9
- import { MatMenuModule , MatButtonModule , MatCardModule , MatSidenavModule , MatListModule } from '@angular/material' ;
7
+ import { BrowserAnimationsModule } from '@angular/platform-browser/animations' ;
8
+ import { MatMenuModule , MatInputModule , MatButtonModule , MatCardModule , MatSidenavModule , MatListModule } from '@angular/material' ;
10
9
import { HeroService } from './hero.service' ;
10
+ import { Routes , RouterModule } from '@angular/router' ;
11
+ import { MatFormFieldModule } from '@angular/material/form-field' ;
12
+ import { ReactiveFormsModule } from '@angular/forms' ;
11
13
12
14
import { AppComponent } from './app.component' ;
13
15
import { HeaderComponent } from './header/header.component' ;
14
16
import { SidenavComponent } from './sidenav/sidenav.component' ;
17
+ import { LoginComponent } from './login/login.component' ;
18
+
19
+ const appRoutes : Routes = [
20
+ { path : '' , component :LoginComponent } ,
21
+ { path : 'header' , component :HeaderComponent }
22
+ ] ;
15
23
16
24
@NgModule ( {
17
25
declarations :[
18
26
AppComponent ,
19
27
HeaderComponent ,
20
- SidenavComponent
28
+ SidenavComponent ,
29
+ LoginComponent
21
30
] ,
22
31
imports :[
23
32
BrowserModule ,
@@ -26,7 +35,12 @@ import { SidenavComponent } from './sidenav/sidenav.component';
26
35
BrowserAnimationsModule ,
27
36
MatToolbarModule ,
28
37
MatIconModule ,
29
- MatMenuModule , MatButtonModule , MatCardModule , MatSidenavModule , MatListModule
38
+ MatInputModule ,
39
+ MatMenuModule , MatButtonModule , MatCardModule , MatSidenavModule , MatListModule ,
40
+ RouterModule . forRoot ( appRoutes ) ,
41
+ MatFormFieldModule ,
42
+ ReactiveFormsModule ,
43
+
30
44
] ,
31
45
providers :[ HeroService ] ,
32
46
bootstrap :[ AppComponent ]
0 commit comments