Skip to content

Instantly share code, notes, and snippets.

@navix
Created January 25, 2019 10:44
Show Gist options
  • Select an option

  • Save navix/fb917485063e5b379db36ef26c440d8d to your computer and use it in GitHub Desktop.

Select an option

Save navix/fb917485063e5b379db36ef26c440d8d to your computer and use it in GitHub Desktop.
Detect router navigation events called by browser in Angular 7

Detect router navigation events called by browser in Angular 7

...
constructor(
  private router: Router,
) {
  this.router.events.subscribe(event => {
    if (event instanceof NavigationStart && event.navigationTrigger === 'popstate') {
      ...
    }
  });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment