import { NgModule } from '@angular/core' ; import { Routes , RouterModule } from '@angular/router' ; import { MainComponent } from './app.component' ; import { SchemaEditComponent } from './schema-edit.component' ; const routes = [ { path : 'schema' , component : SchemaEditComponent } , { path : 'example/:id' , component : MainComponent } , { path : '**' , component : MainComponent } ] ; @ NgModule ( { imports : [ RouterModule . forRoot ( routes , { useHash : true , relativeLinkResolution : 'legacy' } ) ] , exports : [ RouterModule ] } ) export class AppRoutingModule { }