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