Skip to content

Commit 9461930

Browse files
committed
Removed the specialized routing modules.
1 parent 6a83ed4 commit 9461930

File tree

4 files changed

+15
-41
lines changed

4 files changed

+15
-41
lines changed

APM - Final/app/app-routing.module.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

APM - Final/app/app.module.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { NgModule } from '@angular/core';
22
import { BrowserModule } from '@angular/platform-browser';
33
import { HttpModule } from '@angular/http';
4+
import { RouterModule} from '@angular/router';
45

56
import { AppComponent } from './app.component';
6-
import { AppRoutingModule } from './app-routing.module';
77
import { WelcomeComponent } from './home/welcome.component';
88

99
/* Feature Modules */
@@ -13,8 +13,12 @@ import { ProductModule } from './products/product.module';
1313
imports: [
1414
BrowserModule,
1515
HttpModule,
16-
ProductModule,
17-
AppRoutingModule
16+
RouterModule.forRoot([
17+
{ path: 'welcome', component: WelcomeComponent },
18+
{ path: '', redirectTo: 'welcome', pathMatch: 'full'},
19+
{ path: '**', redirectTo: 'welcome', pathMatch: 'full' }
20+
]),
21+
ProductModule
1822
],
1923
declarations: [ AppComponent, WelcomeComponent ],
2024
bootstrap: [ AppComponent ]

APM - Final/app/products/product-routing.module.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

APM - Final/app/products/product.module.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
import { NgModule } from '@angular/core';
2+
import { RouterModule} from '@angular/router';
23

34
import { ProductListComponent } from './product-list.component';
45
import { ProductDetailComponent } from './product-detail.component';
56
import { ProductDetailGuard } from './product-guard.service';
67

78
import { ProductFilterPipe } from './product-filter.pipe';
89
import { ProductService } from './product.service';
9-
import { ProductRoutingModule } from './product-routing.module';
1010

1111
import { SharedModule } from '../shared/shared.module';
1212

1313
@NgModule({
1414
imports: [
1515
SharedModule,
16-
ProductRoutingModule
16+
RouterModule.forChild([
17+
{ path: 'products', component: ProductListComponent },
18+
{ path: 'product/:id',
19+
canActivate: [ ProductDetailGuard],
20+
component: ProductDetailComponent
21+
}
22+
])
1723
],
1824
declarations: [
1925
ProductListComponent,

0 commit comments

Comments
 (0)