-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathapp.module.ts
More file actions
57 lines (54 loc) · 1.45 KB
/
app.module.ts
File metadata and controls
57 lines (54 loc) · 1.45 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
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { RouterModule, Routes } from '@angular/router';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { ProductComponent } from './product/product.component';
import { ProductDetailComponent } from './product-detail/product-detail.component';
import { ProductEditComponent } from './product-edit/product-edit.component';
import { ProductAddComponent } from './product-add/product-add.component';
const appRoutes: Routes = [
{
path: 'products',
component: ProductComponent,
data: { title: 'Product List' }
},
{
path: 'product-details/:id',
component: ProductDetailComponent,
data: { title: 'Product Details' }
},
{
path: 'product-add',
component: ProductAddComponent,
data: { title: 'Product Add' }
},
{
path: 'product-edit/:id',
component: ProductEditComponent,
data: { title: 'Product Edit' }
},
{ path: '',
redirectTo: '/products',
pathMatch: 'full'
}
];
@NgModule({
declarations: [
AppComponent,
ProductComponent,
ProductDetailComponent,
ProductEditComponent,
ProductAddComponent
],
imports: [
RouterModule.forRoot(appRoutes),
FormsModule,
BrowserModule,
HttpClientModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }