src/app/app.routing.module.ts
Главный модуль маршрутизации
import { RouterModule, Routes } from '@angular/router';
import { NgModule } from '@angular/core';
import { HomeComponent } from './home/home';
const APP_ROUTES: Routes = [
{path: '', redirectTo: 'profile', pathMatch: 'full'},
{path: 'profile', loadChildren: './modules/profile/profile.module#ProfileModule'},
{path: 'profile/:id', loadChildren: './modules/profile/profile.module#ProfileModule'},
{path: 'user', loadChildren: './modules/user/user.module#UserModule'},
{path: 'user/:id', loadChildren: './modules/user/user.module#UserModule'},
{path: 'search', loadChildren: './modules/search/search.module#SearchModule'},
{path: 'dashboard', loadChildren: './modules/dashboard/dashboard.module#DashboardModule'},
{path: '**', component: HomeComponent}
];
/**
* Главный модуль маршрутизации
*/
@NgModule({
imports: [
RouterModule.forRoot(APP_ROUTES)
],
exports: [RouterModule]
})
export class AppRoutingModule {
}