В app.ts я ищу, чтобы перейти к home/contract-view/10
в действии. Пытался
this.router.navigateToRoute('home/contract-view', { id: 10}, { absolute: true });
Route home/contract-view not be found
Еще одна попытка:
this.router.navigate('#/home/contract-view', { id: 10});
failed with Route not found: contract-view(…)
Как это сделать? App.ts:
configureRouter(config: RouterConfiguration, router: Router) {
config.title = 'Contracts Portal';
config.map([
{ route: ['', 'dummy'], name: 'dummy', moduleId: 'dummy', nav: false, title: 'Dummy', settings: { pos: 'left' } },
{ route: 'home', name: 'home', moduleId: 'home', nav: true, title: 'Home', settings:{pos: 'left', class: 'home' }, auth: true },
]);
this.router = router;
}
Home.ts:
configureRouter(config: RouterConfiguration, router: Router) {
config.map([
{ route: ['', 'contract-view/:id'], name: 'contract-view', moduleId: 'contract-view', nav: true, title: 'Contract' },
{ route: 'doc-view/:id', name: 'doc-view', href:'doc-view', moduleId: 'doc-view', nav: true, title: 'Document' },
]);
this.router = router;
this.router.refreshNavigation();
}