Skip to content

fix(router): should reset location if a navigation by location is suc… - #13574

Closed
vicb wants to merge 1 commit into
angular:masterfrom
vicb:gh-13545
Closed

vicb wants to merge 1 commit into
angular:masterfrom
vicb:gh-13545

Conversation

@vicb

@vicb vicb commented Dec 19, 2016 •

Copy link
Copy Markdown
Contributor

Supersedes #13545 by also fixing the PathLocationStrategy.

/cc @vsavkin
@chuckjaz please do NOT use GH to merge this one (for attribution)

Closes #13491
Closes #13545
Closes #13574

@googlebot

Copy link
Copy Markdown

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@vicb vicb added area: router action: merge The PR is ready for merge by the caretaker pr_state: LGTM labels Dec 19, 2016
@DzmitryShylovich

Copy link
Copy Markdown
Contributor

I believe it also fixes #12438

this._platformLocation.onPopState(fn);
this._platformLocation.onHashChange(fn);
}
onPopState(fn: LocationChangeListener): void { this._platformLocation.onPopState(fn); }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it should be this._platformLocation.onHashChange(fn); in HashLocationStarategy and this._platformLocation.onPopState(fn); in PathLocationStrategy

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@DzmitryShylovich what are the reasons you think so ?

@DzmitryShylovich DzmitryShylovich Dec 19, 2016 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  1. Readability HashLocationStarategy - onHashChange.
  2. PopState is a part of History api, so I think HashChange has a better support across old/mobile browsers (there're some existing issues related to mobile ie and history api, for example).

@vicb vicb removed the action: merge The PR is ready for merge by the caretaker label Dec 19, 2016
@vicb

vicb commented Dec 21, 2016

Copy link
Copy Markdown
Contributor Author

@vsavkin came with a better fix in #13545

@vicb vicb closed this Dec 21, 2016
@vicb
vicb deleted the gh-13545 branch June 9, 2017 17:17
@angular-automatic-lock-bot

Copy link
Copy Markdown

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 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

First routing to module fails when user navigates by hash changing

4 participants