import { NgModule } from '@angular/core' ; import { Routes , RouterModule } from '@angular/router' ; import { APP_BASE_HREF } from '@angular/common' ; import { EmptyRouteComponent } from './components/empty-route/empty-route.component' ; const routes = [ { path : '**' , component : EmptyRouteComponent } ] ; @ NgModule ( { imports : [ RouterModule . forRoot ( routes , { relativeLinkResolution : 'legacy' } ) ] , exports : [ RouterModule ] , providers : [ { provide : APP_BASE_HREF , useValue : '/' } ] , } ) export class AppRoutingModule { }