Repository navigation
Closed
Labels
P4A relatively minor issue that is not relevant to core functionsarea: routerfreq1: lowrouter: config matching/activation/validationstate: confirmedtype: bug/fix
Milestone
Description
🐞 bug report
Affected Package
The issue is caused by package @angular/router
Is this a regression?
Unsure.
Description
I have a named router outlet which I want to default by redirecting the empty path to one of the named paths, e.g.
{ outlet: 'test', path: '', pathMatch: 'full', redirectTo: 'default' },
{ outlet: 'test', path: 'default', component: TestComponent },
This worked when the configuration was in a lazy loaded module, however moving it to the root router configuration now fails to validate. This configuration seems like it should be valid. The only workaround I could find was to use an absolute path, e.g.
{ path: 'test', pathMatch: 'full', redirectTo: '/test/(test:default)' },
🔬 Minimal Reproduction
🔥 Exception or Error
Error: Invalid configuration of route 'test/': a componentless route without children or loadChildren cannot have a named outlet set
🌍 Your Environment
Angular Version:
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 8.3.17
Node: 12.4.0
OS: darwin x64
Angular: 8.2.13
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
---------------------------------------------------------
@angular-devkit/architect
@angular-devkit/build-angular 0.802.2
@angular-devkit/core
@angular-devkit/schematics
@angular/cdk 7.3.7
@angular/cli 8.3.17
@angular/material 7.3.7
@schematics/angular
@schematics/update
rxjs 6.5.3
typescript 3.5.3
webpack 4.38.0
Anything else relevant?
Nope.
Metadata
Metadata
Assignees
Labels
P4A relatively minor issue that is not relevant to core functionsarea: routerfreq1: lowrouter: config matching/activation/validationstate: confirmedtype: bug/fix
Activity
mduft commentedon Jun 7, 2022
After updating to Angular 14, I got this error for our router configuration. It seems that this was possible all the way from Angular 9 to 13, but no longer for 14:
we had to replace this with:
(note that the default redirect for the 'admin' panel moved from the children to the outer (main) redirect).
this works nearly as well (for us), since we're never directly navigating to /all, but always to (empty), so the default redirect will also redirect the 'admin' outlet correctly. However if a user manually navigates to the /admin/all route without outlet, this will now no longer correctly set the 'admin' outlet to 'general'...
Talb2005 commentedon Oct 2, 2022
Any progress with this issue?
pixeldublu commentedon Oct 30, 2022
I also discovered this issue a few days ago after upgrading. Since there was no activity I decided to create a pull request on this. (
#47921 )
Hopefully gets in soon 🤞
fix(router): fix redirectTo on named outlets - resolves angular#33783
mduft commentedon Nov 2, 2022
Very nice, thanks. Will try this once I have time :| ;)
fix(router): fix redirectTo on named outlets - resolves #33783 (#47927)
fix(router): fix redirectTo on named outlets - resolves #33783 (#47927)
Update angular monorepo (#1632)
angular-automatic-lock-bot commentedon Dec 5, 2022
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
fix(router): fix redirectTo on named outlets - resolves angular#33783 (…