A route change can be detected using the router.events stream. ( How to detect a route change in Angular 2? ).
router.events
But I'm not sure how to detect a change in the browser URL.
You can enter Location and subscribe to it
Location
constructor(location:Location) { location.subscribe(val => console.log(val); }
As Harry said. It only notifies popState events (router or similar code changing the url)
Source: https://habr.com/ru/post/1257827/More articles:How to pass an event handler to a child component in React - javascriptXcode 8 Objective-C CoreData Class Classes Destroyed? - xcodeHow to convert factor variables with one-hot coding using data.table? - rGit network operations behind a corporate firewall using LibGit2Sharp throws - git-pushCould not install proxy: invalid libgit2sharp parameter - c #How to select text inside curly braces in Visual Studio code? - visual-studio-codeReact Native: How to remove a token using AsyncStorage using JWT? - javascriptHow to change email in firebase auth? - javascriptJson Response Request - jsonAngular 2 Custom Test Modulation Testing - angularAll Articles