Hello I am attempting to lazy load a "detail module" while also sending parameters via the URL.
Here is my lazy loaded route:
{
path: 'venue/:name/:id',
loadChildren: () => System.import('../containers/activity-detail/activity-detail.module').then((file: any) => {
return file.default;
})
},
I would like to route to this 'activity-detail.module' and then load details using the ":name", and "id:" parameters.
The module which loads has its own routes file.
export const VenueDetailRoutes: Route[] = [
{
path: '',
redirectTo: 'venue/:name/:id',
pathMatch: 'full'
},
{
path: 'venue/:name/:id',
component: VenueDetailComponent,
data: {
shouldDetach: true, // Route will be resused. See CustomResuseStrategy.
title: null
}
},
{
path: '**',
redirectTo: '/'
}
];
It seems without the first default object nothing works. I get the error:
{
path: '',
redirectTo: 'venue/:name/:id',
pathMatch: 'full'
},
TypeError: Cannot read property 'path' of null
With the default object in place I get the error:
Error: Cannot redirect to 'venue/:name/:id'. Cannot find ':name'.
Any help would be greatly appreciated.