Skip to content

feat(router): add a currentNavigation signal to the Router service. #63011

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

JeanMeche
Copy link
Member

@JeanMeche JeanMeche commented Aug 5, 2025

This #62971 re-opened


This new signal property is convenient to derive a isNavigating state.

isNavigating = computed(() => !!this.router.currentNavigation())

DEPRECATED: The Router.getCurrentNavigation method is deprecated. Use the Router.currentNavigation signal instead.

fixes #62958

@pullapprove pullapprove bot requested a review from kirjs August 5, 2025 16:07
@angular-robot angular-robot bot added detected: deprecation PR contains a commit with a deprecation detected: feature PR contains a feature commit area: router labels Aug 5, 2025
@ngbot ngbot bot modified the milestone: Backlog Aug 5, 2025
@JeanMeche JeanMeche added the target: minor This PR is targeted for the next minor release label Aug 5, 2025
@JeanMeche JeanMeche force-pushed the router/currentNavigation-signal branch from feb070a to 9307c27 Compare August 5, 2025 17:00
@atscott atscott added the action: merge The PR is ready for merge by the caretaker label Aug 5, 2025
@pullapprove pullapprove bot requested review from crisbeto and mmalerba August 5, 2025 17:12
@atscott atscott removed the action: merge The PR is ready for merge by the caretaker label Aug 5, 2025
@JeanMeche JeanMeche force-pushed the router/currentNavigation-signal branch 6 times, most recently from 32f84e5 to 78f36a9 Compare August 5, 2025 21:54
Copy link
Contributor

@thePunderWoman thePunderWoman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: public-api, size-tracking

@crisbeto
Copy link
Member

crisbeto commented Aug 6, 2025

We should run a TGP for this since it broke some targets last time around.

This new signal property is convenient to derive a `isNavigating` state.

`isNavigating = computed(() => !!this.router.currentNavigation())`

DEPRECATED: The Router.getCurrentNavigation method is deprecated. Use the Router.currentNavigation signal instead.

fixes angular#62958
@JeanMeche JeanMeche force-pushed the router/currentNavigation-signal branch from 78f36a9 to e650fb4 Compare August 6, 2025 10:02
@JeanMeche
Copy link
Member Author

TGP is "green"

@atscott atscott added the action: merge The PR is ready for merge by the caretaker label Aug 6, 2025
@atscott
Copy link
Contributor

atscott commented Aug 6, 2025

This PR was merged into the repository by commit 687c374.

The changes were merged into the following branches: main

@atscott atscott closed this in 687c374 Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: router detected: deprecation PR contains a commit with a deprecation detected: feature PR contains a feature commit target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getCurrentNavigation() returns a Navigation object even after NavigationEnd
5 participants