Skip to content

Router: location.path is old URL during all component hooks. Updates after a tick. #10909

Closed

Description

@wardbell

I'm submitting a ... (check one with "x")

[x] bug report 
[ ] feature request
[ ] support request 

Current behavior

The location.path() value remains the old URL after a component's Lifecycle Hooks have been called.

After a tick, the location.path() value becomes the current URL.

Have been told that this change arrived within the last few RCs.

Expected/desired behavior

Expect location.path() to become the new URL at least by ngOnInit. By that time, the navigation is complete and all components should be in the DOM.

Reproduction of the problem

http://plnkr.co/edit/WUbTMlukBIYJF3WXYVIj?p=preview

Please tell us about your environment:

  • Angular version: 2.0.0-rc.5
  • Browser: [all ]
  • Language: [all ]

Activity

  1. self-assigned this
    on Aug 19, 2016
  2. vsavkin commented on Aug 28, 2016

    @vsavkin
    Contributor

    Fixed here #11063

  3. angular-automatic-lock-bot commented on Sep 9, 2019

    @angular-automatic-lock-bot

    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.

  4. locked and limited conversation to collaborators on Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions