у вас должно быть что-то вроде yourcomponent-routing-module.ts или app-routing.module.ts
Если у вас его нет, сгенерируйте его, используя угловой кли.
ng generate module SomeModule --routing (or ng g m SomeModule --routing, for short)
Вот пример модуля маршрутизации. Маршрут нацелен на https: yoursite / dashboard / mydashboardtypevalue
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { DashboardComponent } from './dashboard.component';
import { DashboardContainerComponent } from './dashboard- container/dashboard-container.component';
import { RequiredAuthenticatedUserRouteGuardService } from '../shared/services/required-authenticated-user-route-guard/required-authenticated-user-route-guard.service';
const routes: Routes = [{
path: 'dashboard',
component: DashboardComponent,
canActivate: [ RequiredAuthenticatedUserRouteGuardService ],
children: [
{ path: ':dashboardType', component: DashboardContainerComponent } // this is a sample required parameter
]},
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class DashboardRoutingModule { }