import { NgModule } from '@angular/core' ; import { RouterModule , Routes } from '@angular/router' ; import { OverviewComponent } from './overview/overview.component' ; import { ApiComponent } from './api/api.component' ; import { ExamplesPageComponent } from './examples-page/examples-page.component' ; const routes = [ { path : 'overview' , component : OverviewComponent } , { path : 'api' , component : ApiComponent } , { path : 'examples' , component : ExamplesPageComponent } , { path : '' , pathMatch : 'full' , redirectTo : 'overview' } ] ; @ NgModule ( { imports : [ RouterModule . forRoot ( routes ) ] , exports : [ RouterModule ] } ) export class AppRoutingModule { }