Product-Details aus Tutorial übernommen
[examples/angular-tutorial] / src / app / app.module.ts
1 import { BrowserModule } from '@angular/platform-browser';
2 import { NgModule } from '@angular/core';
3 import { RouterModule } from '@angular/router';
4
5 import { AppComponent } from './app.component';
6 import { TopBarComponent } from './top-bar/top-bar.component';
7 import { ProductListComponent } from './product-list/product-list.component';
8 import { ProductDetailsComponent } from './product-details/product-details.component';
9
10 @NgModule({
11   declarations: [
12     AppComponent,
13     TopBarComponent,
14     ProductListComponent,
15     ProductDetailsComponent
16   ],
17   imports: [
18     BrowserModule,
19     RouterModule.forRoot([
20       { path: '', component: ProductListComponent },
21       { path: 'products/:productId', component: ProductDetailsComponent }
22     ])
23   ],
24   providers: [],
25   bootstrap: [AppComponent]
26 })
27 export class AppModule { }