July 2017
Intermediate to advanced
454 pages
10h 1m
English
We need to set up the error messages for page not found or 404 pages. We can use the ErrorPageNotFoundComponent component to display the page not found or error messages for paths that are unknown to the router:
const appRoutes: Routes = [ { path: 'about', component: AboutComponent }, { path: 'services', component: ServicesComponent }, { path: 'old-products', redirectTo:'/new-products', pathMatch:'full'}, { path: '**', component: ErrorPageNotFoundComponent }, { path: 'content', component: ContentFarmComponent, outlet: 'content- farm' }];
At this stage, with all the information about how to use the router with various aspects, let's add all of them to our app.component.ts file:
import { Component, ...Read now
Unlock full access