December 2017
Beginner
372 pages
10h 32m
English
We learned about routing in the previous chapter, so we will not discuss it here in much detail. Our routing is defined in the app.module.ts file. We only have two routes for our application—one for our default route for the homepage and the other route for BoardComponent.
The route for our Board component will take one parameter, id, which will be the ID of the board selected on the homepage. The following is the code of the app.module.ts file, where we have defined the routes and imported them into NgModule:
const appRoutes: Routes = [ { path: 'board/:id', component: BoardComponent,pathMatch:"full" }, { path: '', component: HomepageComponent },];imports: [ BrowserModule, HttpModule, FormsModule, RouterModule.forRoot(appRoutes ...
Read now
Unlock full access