import { NgModule } from '@angular/core' ; import { Routes , RouterModule } from '@angular/router' ; import { HomeComponent } from './home.component' ; export const routes = [ { path : '' , redirectTo : '/home' , pathMatch : 'full' } , { path : 'home' , component : HomeComponent , data : { text : "Home" } } ] ; @ NgModule ( { imports : [ RouterModule . forRoot ( routes ) ] , exports : [ RouterModule ] } ) export class AppRoutingModule { }