Skip to content

Routing: redirectTo does not propagate all params in route #33603

Description

@IliasDewachter

Which @angular/* package(s) are the source of the bug?

router

Is this a regression?

Yes

Description

With the following route config:

export const routes: Routes = [{
    path: ':tenantId/:projectId',
    component: JustAComponent,
    children: [
        { path: '', redirectTo: 'detail', pathMatch: 'full' },
    ],
}];

When navigating to http://localhost:4200/my-tenant/my-project, you get redirected to http://localhost:4200/my-tenant/:projectId/detail and the my-project param is gone.

This is regression that I noticed when bumping from 21.2.9 to 21.2.17.

Changing redirectTo: 'detail' to redirectTo: () => 'detail' seems to fix the issue.

Please provide a link to a minimal reproduction of the bug

https://github.com/IliasDewachter/Angular-redirectTo-bug-repro

Please provide the exception or error you saw


Please provide the environment you discovered this bug in (run ng version)

Angular CLI       : 21.2.18
Angular           : 21.2.17
Node.js           : 24.12.0
Package Manager   : npm 11.14.0
Operating System  : win32 x64

┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package                   │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build            │ 21.2.18           │ ^21.2.18          │
│ @angular/cli              │ 21.2.18           │ ^21.2.18          │
│ @angular/common           │ 21.2.17           │ ^21.2.0           │
│ @angular/compiler         │ 21.2.17           │ ^21.2.0           │
│ @angular/compiler-cli     │ 21.2.17           │ ^21.2.0           │
│ @angular/core             │ 21.2.17           │ ^21.2.0           │
│ @angular/forms            │ 21.2.17           │ ^21.2.0           │
│ @angular/platform-browser │ 21.2.17           │ ^21.2.0           │
│ @angular/platform-server  │ 21.2.17           │ ^21.2.0           │
│ @angular/router           │ 21.2.17           │ ^21.2.0           │
│ @angular/ssr              │ 21.2.18           │ ^21.2.18          │
│ rxjs                      │ 7.8.2             │ ~7.8.0            │
│ typescript                │ 5.9.3             │ ~5.9.2            │
│ vitest                    │ 4.1.10            │ ^4.0.8            │
└───────────────────────────┴───────────────────┴───────────────────┘

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions