Skip to content

getCurrentNavigation() returns a Navigation object even after NavigationEnd #62958

@asfound

Description

@asfound

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

router

Is this a regression?

No

Description

According to the Angular documentation, the router.getCurrentNavigation() method should return null once navigation has completed. However, when subscribing to the Router events and listening for the NavigationEnd event, router.getCurrentNavigation() still returns a non-null Navigation object.

Expected Behaviour:
router.getCurrentNavigation() should return null when the NavigationEnd event is emitted.

Actual Behavior:
router.getCurrentNavigation() continues to return a Navigation object even during the NavigationEnd event.

Image

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/angular-i278fkgd?file=src%2Fmain.ts

Please provide the exception or error you saw


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

Angular CLI: 20.1.1
Node: 22.14.0
Package Manager: npm 11.4.2
OS: darwin x64

Angular: 20.1.2
... cdk, common, compiler, compiler-cli, core, forms, material
... platform-browser, router

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.2001.1
@angular-devkit/core         20.1.1
@angular-devkit/schematics   20.1.1
@angular/build               20.1.1
@angular/cli                 20.1.1
@schematics/angular          20.1.1
rxjs                         7.8.2
typescript                   5.8.3
zone.js                      0.15.1

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2The issue is important to a large percentage of users, with a workaroundarea: docsRelated to the documentation

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions