70
70
import { NgModule } from ' @angular/core' ;
71
71
import { Routes , RouterModule } from ' @angular/router' ;
72
72
73
- import { DepartmentContactComponent } from ' ./components/department-contact/department-contact.component' ;
74
- import { DepartmentDetailsComponent } from ' ./components/department-details/department-details.component' ;
75
73
import { DepartmentListComponent } from ' ./components/department-list/department-list.component' ;
76
- import { DepartmentOverviewComponent } from ' ./components/department-overview/department-overview.component' ;
77
74
import { EmployeeListComponent } from ' ./components/employee-list/employee-list.component' ;
78
75
import { HomeComponent } from ' ./components/home/home.component' ;
79
76
import { ProductListComponent } from ' ./components/product-list/product-list.component' ;
80
- import { WildcardPagenotfoundComponent } from ' ./components/wildcard-pagenotfound/wildcard-pagenotfound.component' ;
81
77
82
78
const routes: Routes = [
83
79
// default path
84
80
// { path: '', component:DepartmentListComponent},
85
81
{ path: ' home' , component: HomeComponent },
86
- { path: ' ' , redirectTo: ' home' , pathMatch: ' full' },
87
82
{ path: ' departments' , component: DepartmentListComponent },
88
- {
89
- path: ' departments/:id' ,
90
- component: DepartmentDetailsComponent ,
91
- children: [
92
- { path: ' overview' , component: DepartmentOverviewComponent },
93
- { path: ' contact' , component: DepartmentContactComponent },
94
- ]
95
- },
96
83
{ path: ' employees' , component: EmployeeListComponent },
97
84
{ path: ' products' , component: ProductListComponent },
98
- { path: ' **' , component: WildcardPagenotfoundComponent }
99
85
];
100
86
101
87
@NgModule ({
@@ -107,14 +93,10 @@ export class AppRoutingModule { }
107
93
// to store all routing component and avoid importing/writing duplicate list of components in app.routing.module / app.module.
108
94
// create an array of all routing components export it, then import it in app.module.ts
109
95
export const RoutingComponents = [
110
- DepartmentContactComponent ,
111
- DepartmentDetailsComponent ,
112
96
DepartmentListComponent ,
113
- DepartmentOverviewComponent ,
114
97
EmployeeListComponent ,
115
98
HomeComponent ,
116
99
ProductListComponent ,
117
- WildcardPagenotfoundComponent ,
118
100
]
119
101
```
120
102
0 commit comments