I’m trying to create a child route with an :id parameter.
I get: [app-router] Error: Route not found: {id-goes-here}
.
The generated url I get is: #/meetings/meeting/{guid-goes-here}
, so it looks correct, #/meetings
being the main route.
This is my child router config (I inject the router in the constructor):
public configureRouter(routerConfig: RouterConfiguration): void {
routerConfig.title = '';
routerConfig.map([
{
route: 'meeting/:id?',
name: 'meeting',
moduleId: '../Views/meeting',
title: 'Möte',
settings: {
view: './meeting.html'
}
}
]);
}
Then I try to access it like this (I’m using generate() to be able to debug the url):
public selectMeeting(id?: any): void {
let url: string = this.router.generate('meeting', {id});
this.router.navigate(url);
}
But then I get: [app-router] Error: Route not found: {id-goes-here}
.
Shouldn’t the error message be: [app-router] Error: Route not found: meeting/{id-goes-here}
?
And why is it not found?
Am I missing some basic stuff here? I’ve basically copied the example of the skeleton navigation for typescript, with the exception for the :id parameter. Is there more magic to child routes that I think there is?