I am trying to set a default route in my sub-component (using useAsDefault: true
) and have parameters automatically passed to it, but I can't seem to find any information on how to accomplish this in the documentation.
I have a parent component with the following route:
$routeConfig = [
{ path: '/employees/...', component: 'employeesComponent', name: 'Employees'}
]
and a child component with:
$routeConfig = [
{ path: '/:group/:filter', component: 'employeeListComponent', name: 'Group', useAsDefault: true}
{ path: '/details/:employeeId/...', component: 'profileComponent', name: 'EmployeeProfile'}
]
This configuration results in the error:
Route generator for 'group' was not included in parameters passed.
I haven't been able to figure out how to pass default parameters to the first route. My current workaround involves creating another route without params and using it as a default:
{ path: '/all', component: 'employeeListComponent', name: 'All', useAsDefault: true}
but this solution is less than ideal. I've considered redirecting immediately with some default parameters after navigating to a route without params, but I'm hoping there's a better way to handle this issue. Any suggestions?