-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Description
Angular's router upgrade code provides a setUpLocationSync method which listens for AngularJS-initiated $locationChangeStart events, then calls Angular's router.navigateByUrl. The docs for this method state that "History.pushState does not fire onPopState, so the Angular location doesn't detect it. The workaround is to attach a location change listener"(
| * History.pushState does not fire onPopState, so the Angular location |
While this code works for AngularJS-initiated location changes, it currently produces duplicate NavigationStart, etc. events for Angular-initiated changes. The AngularJS router sees that the browser location has changed and triggers a location change event, which in turn triggers an additional NavigationStart event in Angular. It appears that we need some way to trigger Angular navigation only for location changes that originate in AngularJS.
This issue is currently causing duplicate router events for any Angular-driven page transition in dual-router apps, which is a performance issue.