Created
December 6, 2017 03:16
-
-
Save thefln/f25e2cc4e7adfb4df6335ba43cd7a796 to your computer and use it in GitHub Desktop.
ngmodule-declaration.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { NgModule } from '@angular/core'; | |
| import { BrowserModule } from '@angular/platform-browser'; | |
| import { HttpClientModule } from '@angular/common/http'; | |
| import { RouterModule, Routes } from '@angular/router'; | |
| import { AppComponent } from './app.component'; | |
| import { ProductComponent } from './components/product/product.component'; | |
| import { ProductsComponent } from './components/products/products.component'; | |
| const appRoutes: Routes = [ | |
| { path: 'product/:id', component: ProductComponent }, | |
| { path: '', component: ProductsComponent } | |
| ] | |
| @NgModule({ | |
| declarations: [ | |
| AppComponent, | |
| ProductComponent, | |
| ProductsComponent | |
| ], | |
| imports: [ | |
| RouterModule.forRoot(appRoutes), | |
| BrowserModule, | |
| HttpClientModule | |
| ], | |
| providers: [], | |
| bootstrap: [ AppComponent ] | |
| }) | |
| export class AppModule { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment