Skip to content
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

Some location change events are no longer after router upgrade #24429

Closed
vincentjames501 opened this Issue Jun 11, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@vincentjames501
Copy link

vincentjames501 commented Jun 11, 2018

I'm submitting a...


[ x ] Regression (a behavior that used to work and stopped working in a new release)

Current behavior

We are running a hybrid application and we have some AngularJS code that calls $location.path(...) to change routes. This commit c40ae7f introduced an issue where when our AngularJS code changes its location to an Angular route, Angular never gets notified of this change (enableTracing: true shows this as well). If I simply change line 738 in the aforementioned commit (between router version 6.0.0.beta1 and 6.0.0.beta2) to what it was previously:

if (this.location.isCurrentPathEqualTo(path) || replaceUrl) {
  this.location.replaceState(path);
} else {
  this.location.go(path);
}

Angular still gets notified correctly of these route changes.

Expected behavior

I expect that when $location.path(...) is invoked outside of Angular, that Angular still picks up on the location change so the correct components can be loaded.

Environment


Angular version: 6.0.4

Browser:
- [ x ] Chrome (desktop) version 67
 
For Tooling issues:
- Node version: 9.11.1
- Platform:  Mac

@vincentjames501

This comment has been minimized.

Copy link
Author

vincentjames501 commented Jun 11, 2018

Looks like this is related to #21995 #21728

@ngbot ngbot bot added this to the needsTriage milestone Jun 12, 2018

@ngbot ngbot bot modified the milestones: needsTriage, Backlog Jun 12, 2018

jasonaden added a commit to jasonaden/angular that referenced this issue Feb 8, 2019

feat(router): add hash-based navigation option to setUpLocationSync
The `setUpLocationSync` function in @angular/router/upgrade didn't previously let you sync hash-based navigations. With this change, you can now pass an option to `setUpLocationSync` that will make sure location changes run in Angular in hash-based apps.

Fixes angular#24429 angular#21995

jasonaden added a commit to jasonaden/angular that referenced this issue Feb 8, 2019

feat(router): add hash-based navigation option to setUpLocationSync
The `setUpLocationSync` function in @angular/router/upgrade didn't previously let you sync hash-based navigations. With this change, you can now pass an option to `setUpLocationSync` that will make sure location changes run in Angular in hash-based apps.

Fixes angular#24429 angular#21995

jasonaden added a commit to jasonaden/angular that referenced this issue Feb 13, 2019

feat(router): add hash-based navigation option to setUpLocationSync
The `setUpLocationSync` function in @angular/router/upgrade didn't previously let you sync hash-based navigations. With this change, you can now pass an option to `setUpLocationSync` that will make sure location changes run in Angular in hash-based apps.

Fixes angular#24429 angular#21995
@TheeRFG

This comment has been minimized.

Copy link

TheeRFG commented Feb 16, 2019

I've recently attempted to upgrade from Angular5 to Angular7 and I've noticed this issue as well. Routing is so intermittently inconsistent I would honestly deem this as unusable. We've actually had to revert our entire upgrade and stay on version 5 because of this.

jasonaden added a commit to jasonaden/angular that referenced this issue Feb 19, 2019

feat(router): add hash-based navigation option to setUpLocationSync
The `setUpLocationSync` function in @angular/router/upgrade didn't previously let you sync hash-based navigations. With this change, you can now pass an option to `setUpLocationSync` that will make sure location changes run in Angular in hash-based apps.

Fixes angular#24429 angular#21995

IgorMinar added a commit that referenced this issue Feb 20, 2019

feat(router): add hash-based navigation option to setUpLocationSync (#…
…28609)

The `setUpLocationSync` function in @angular/router/upgrade didn't previously let you sync hash-based navigations. With this change, you can now pass an option to `setUpLocationSync` that will make sure location changes run in Angular in hash-based apps.

Fixes #24429 #21995

PR Close #28609

@IgorMinar IgorMinar closed this in 71d0eeb Feb 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.