December 2017
Beginner
372 pages
10h 32m
English
The router must be configured with the list of route definitions, with each definition specifying the route. We imported the route module from Angular in preceding section. This route module provides us with the Route property, which takes an array of objects with each object defining a specific route. Let's look at our Route array as defined in our app.route.ts file:
import { ModuleWithProviders } from '@angular/core';import { Routes, RouterModule } from '@angular/router';import { NewsComponent } from './dashboard/news/news.component';const routes: Routes = [ {path: '', redirectTo: 'nfl', pathMatch: 'full'}, { path: 'nfl', component: NewsComponent, data: {feedType: 'nfl-news',source:'nfl'} }, { path: 'espn', component: ...
Read now
Unlock full access