import { NgModule } from '@angular/core' ; import { RouterModule , Routes } from '@angular/router' ; import { HomeComponent } from './pages/home.component' ; import { TestComponent } from './pages/test.component' ; const routes = [ { path : '' , component : HomeComponent , pathMatch : 'full' } , { path : 'home' , component : HomeComponent } , { path : 'test' , component : TestComponent } , ] ; @ NgModule ( { imports : [ RouterModule . forRoot ( routes ) ] , exports : [ RouterModule ] } ) export class AppRoutesModule { }