Skip to content

Conversation

@JeanMeche
Copy link
Member

@JeanMeche JeanMeche commented Aug 3, 2025

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.

@ngbot ngbot bot added this to the Backlog milestone Aug 3, 2025
@JeanMeche JeanMeche force-pushed the router/currentNavigation-signal branch 2 times, most recently from 2bbc640 to b53f184 Compare August 3, 2025 16:29
@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Aug 3, 2025
@JeanMeche JeanMeche closed this Aug 3, 2025
@JeanMeche JeanMeche force-pushed the router/currentNavigation-signal branch from b53f184 to 3e6e1c1 Compare August 3, 2025 16:35
@JeanMeche JeanMeche reopened this Aug 3, 2025
@JeanMeche JeanMeche force-pushed the router/currentNavigation-signal branch 3 times, most recently from a9aca0b to c1ed455 Compare August 3, 2025 16:48
@JeanMeche JeanMeche changed the title feature(router): add a currentNavigation signal to the Router feat(router): add a currentNavigation signal to the Router Aug 3, 2025
@JeanMeche JeanMeche requested a review from atscott August 3, 2025 16:56
@JeanMeche JeanMeche marked this pull request as ready for review August 3, 2025 16:56
@JeanMeche JeanMeche force-pushed the router/currentNavigation-signal branch from c1ed455 to 884fda4 Compare August 3, 2025 16:58
@angular-robot angular-robot bot added the detected: deprecation PR contains a commit with a deprecation label Aug 3, 2025
@JeanMeche JeanMeche force-pushed the router/currentNavigation-signal branch from 884fda4 to 71c76a1 Compare August 3, 2025 17:23

await runMigration();
expect(tree.readContent('/test.ts')).toContain(
'const currentNavigation = this.router.currentNavigation();',
Copy link
Member Author

Choose a reason for hiding this comment

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

I've been wondering if the migration should also untrack the signal read.

Copy link
Contributor

Choose a reason for hiding this comment

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

While that would technically be most equivalent to the current getCurrentNavigation behavior, I think it's probably best to assume it matters that things change and to recompute results when they do.

@JeanMeche JeanMeche added the target: minor This PR is targeted for the next minor release label Aug 3, 2025
@JeanMeche JeanMeche force-pushed the router/currentNavigation-signal branch from 71c76a1 to c59b7d4 Compare August 3, 2025 19:56
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 c59b7d4 to ced90b9 Compare August 4, 2025 10:21
@pullapprove pullapprove bot requested review from devversion, kirjs and mmalerba August 4, 2025 16:07
Copy link
Contributor

@atscott atscott 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

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

@thePunderWoman thePunderWoman removed the request for review from kirjs August 4, 2025 16:12
@atscott atscott added the action: merge The PR is ready for merge by the caretaker label Aug 4, 2025
@crisbeto
Copy link
Member

crisbeto commented Aug 5, 2025

This PR was merged into the repository by commit d00b3fe.

The changes were merged into the following branches: main

@crisbeto crisbeto closed this in d00b3fe Aug 5, 2025
crisbeto added a commit to crisbeto/angular that referenced this pull request Aug 5, 2025
crisbeto added a commit that referenced this pull request Aug 5, 2025
JeanMeche added a commit to JeanMeche/angular that referenced this pull request Aug 5, 2025
…ngular#62971)

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
@crisbeto
Copy link
Member

crisbeto commented Aug 5, 2025

Reopening since we had to roll it back.

@@ -0,0 +1,28 @@
## Remove `Router.getCurrentNavihation` migration

Choose a reason for hiding this comment

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

Typo mistake

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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