import { NgModule } from '@angular/core' ; import { Routes , RouterModule } from '@angular/router' ; import { DashboardComponent } from './dashboard/dashboard.component' ; import { SettingsComponent } from './settings/settings.component' ; const routes = [ { path : 'dashboard' , component : DashboardComponent } , { path : 'settings' , component : SettingsComponent } , { path : '**' , redirectTo : '/dashboard' } , ] ; @ NgModule ( { imports : [ RouterModule . forRoot ( routes ) ] , exports : [ RouterModule ] } ) export class AppRoutingModule { }