假设我有这个路由配置
exp或t const EmployeeRoutes = [
{ path: 'sales', component: SalesComponent },
{ path: 'contacts', component: ContactsComponent }
];
并通过这个URL导航到SalesComponent
/department/7/employees/45/sales
现在我想转到contacts
,但由于我没有绝对路由的所有参数(例如,上例中的部门ID,7
),我更喜欢使用相对链接,例如.
[routerLink]="['../contacts']"
或
this.router.navigate('../contacts')
which unf或tunately doesn't w或k. There may be an obvious solution but I'm not seeing it. Can anyone help out here please?