src/app/app-routing.module.ts
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
const routes: Routes = [
{ path: 'search', loadChildren: 'src/app/search-ui/search-ui.module#SearchUiModule' },
{
path: '',
redirectTo: '/search',
pathMatch: 'full'
}
];
@NgModule({
imports: [RouterModule.forRoot(routes, { useHash: true })],
exports: [RouterModule]
})
export class AppRoutingModule {}