angular2-router

How do I navigate to a sibling route?

匆匆过客 提交于 2019-11-26 15:51:57
问题 Let's presume I got this router config export const EmployeeRoutes = [ { path: 'sales', component: SalesComponent }, { path: 'contacts', component: ContactsComponent } ]; and have navigated to the SalesComponent via this URL /department/7/employees/45/sales Now I'd like to go to contacts , but as I don't have all the parameters for an absolute route (e.g. the department ID, 7 in the above example) I'd prefer to get there using a relative link, e.g. [routerLink]="['../contacts']" or this