File tree 4 files changed +52
-18
lines changed
4 files changed +52
-18
lines changed Original file line number Diff line number Diff line change
1
+ import { NgModule } from '@angular/core' ;
2
+ import { RouterModule , Routes } from '@angular/router' ;
3
+
4
+ import { LoginComponent } from './login/login.component' ;
5
+ import { DashboardComponent } from './dashboard/dashboard.component' ;
6
+
7
+ import { AuthService } from './services/auth.service' ;
8
+
9
+ const routes : Routes = [
10
+ {
11
+ path : '' ,
12
+ redirectTo : 'login' ,
13
+ pathMatch : 'full'
14
+ } ,
15
+ {
16
+ path : 'login' ,
17
+ component : LoginComponent
18
+ } ,
19
+ {
20
+ path : 'dashboard' ,
21
+ component : DashboardComponent ,
22
+ canActivate : [ AuthService ]
23
+ }
24
+ ] ;
25
+
26
+ @NgModule ( {
27
+ imports : [
28
+ RouterModule . forRoot ( routes )
29
+ ] ,
30
+ exports : [
31
+ RouterModule
32
+ ]
33
+ } )
34
+ export class AppRoutingModule { }
Original file line number Diff line number Diff line change 1
1
import { BrowserModule } from '@angular/platform-browser' ;
2
2
import { NgModule } from '@angular/core' ;
3
3
import { ReactiveFormsModule } from '@angular/forms' ;
4
- import { RouterModule , Routes } from '@angular/router' ;
5
4
import { HttpClientModule } from '@angular/common/http' ;
6
5
7
6
import { AppComponent } from './app.component' ;
@@ -11,23 +10,8 @@ import { HeaderComponent } from './header/header.component';
11
10
import { FooterComponent } from './footer/footer.component' ;
12
11
13
12
import { AuthService } from './services/auth.service' ;
13
+ import { AppRoutingModule } from './app-routing.module' ;
14
14
15
- const routes : Routes = [
16
- {
17
- path : '' ,
18
- redirectTo : 'login' ,
19
- pathMatch : 'full'
20
- } ,
21
- {
22
- path : 'login' ,
23
- component : LoginComponent
24
- } ,
25
- {
26
- path : 'dashboard' ,
27
- component : DashboardComponent ,
28
- canActivate : [ AuthService ]
29
- }
30
- ] ;
31
15
32
16
@NgModule ( {
33
17
declarations : [
@@ -41,7 +25,7 @@ const routes: Routes = [
41
25
BrowserModule ,
42
26
HttpClientModule ,
43
27
ReactiveFormsModule ,
44
- RouterModule . forRoot ( routes )
28
+ AppRoutingModule
45
29
] ,
46
30
providers : [ AuthService ] ,
47
31
bootstrap : [ AppComponent ]
Original file line number Diff line number Diff line change
1
+ {
2
+ "mysql" : {
3
+ "host" : " localhost" ,
4
+ "user" : " root" ,
5
+ "password" : " root" ,
6
+ "database" : " angular5-admin"
7
+ }
8
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "mysql" : {
3
+ "host" : " localhost" ,
4
+ "user" : " root" ,
5
+ "password" : " root" ,
6
+ "database" : " angular5-admin"
7
+ }
8
+ }
You can’t perform that action at this time.
0 commit comments