Sitelet https://github.com/angular/angular/pull/70321
Skip to content

feat(router): allow string destination in RedirectCommand - #70321

Open
atscott wants to merge 1 commit into
angular:mainfrom
atscott:stringredirectcommand
Open

feat(router): allow string destination in RedirectCommand#70321
atscott wants to merge 1 commit into
angular:mainfrom
atscott:stringredirectcommand

Conversation

@atscott

@atscott atscott commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

RedirectCommand now accepts a URL string starting with '/' in addition to UrlTree. This improves developer experience by allowing guards, resolvers, and error handlers to redirect to absolute paths without requiring the Router to be injected solely to call parseurl().

BREAKING CHANGE: RedirectCommand.redirectTo can now be a string

The redirectTo property on RedirectCommand can now be a string (specifically UrlTree | '/${string}'). Any code reading RedirectCommand.redirectTo directly may need to handle string values in addition to UrlTree.

RedirectCommand now accepts a URL string starting with '/' in addition to UrlTree. This improves developer experience by allowing guards, resolvers, and error handlers to redirect to absolute paths without requiring the Router to be injected solely to call parseurl().

BREAKING CHANGE: `RedirectCommand.redirectTo` can now be a string

The `redirectTo` property on `RedirectCommand` can now be a `string` (specifically `UrlTree | '/${string}'`). Any code reading `RedirectCommand.redirectTo` directly may need to handle `string` values in addition to `UrlTree`.
@atscott atscott added state: blocked target: major This PR is targeted for the next major release labels Aug 20, 2026
@angular-robot angular-robot Bot added detected: breaking change PR contains a commit with a breaking change detected: feature PR contains a feature commit area: router labels Aug 20, 2026
@ngbot ngbot Bot added this to the Backlog milestone Aug 20, 2026
@atscott
atscott marked this pull request as ready for review August 20, 2026 20:54
@pullapprove
pullapprove Bot requested review from crisbeto and kirjs August 20, 2026 20:54
@JeanMeche JeanMeche modified the milestones: Backlog, v23 candidates Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: router detected: breaking change PR contains a commit with a breaking change detected: feature PR contains a feature commit state: blocked target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants