angular/packages/router/upgrade
Andrew Scott 202a1a5631 fix(upgrade): Do not trigger duplicate navigation events from Angular Router (#43441)
This code mimics behavior that Google Analytics has been using to
prevent duplicate navigations. They set up their own `HybridRoutingService`
location sync to avoid duplicate navigations that came from the Angular
router. This would happen because the Angular router would trigger a
navigation, which would then get picked up by the `$locationShim`, which
would trigger a `$locationChangeStart`, which would then be picked up by
the `setUpLocationSync` watcher here, which would again trigger a
navigation in the Angular Router.

All of this can be prevented by checking if the `navigationId` exists on
the history state object. This property is added by the Angular router
during navigations.

fixes #21610

PR Close #43441
2022-02-02 19:51:20 +00:00
..
src fix(upgrade): Do not trigger duplicate navigation events from Angular Router (#43441) 2022-02-02 19:51:20 +00:00
test fix(upgrade): Do not trigger duplicate navigation events from Angular Router (#43441) 2022-02-02 19:51:20 +00:00
BUILD.bazel build: turn off dts bundling for packages that still are not supported (#29128) 2019-03-07 10:47:20 -08:00
index.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
package.json build: simplify package.jsons for all of our packages (#36944) 2020-05-06 13:54:26 -07:00
PACKAGE.md docs: clean up router api doc (#31476) 2019-07-18 10:33:17 -07:00
public_api.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00