Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    Thanks. So there isn't any built-in way to catch all URL change then. not like: $rootScope.$on('$stateChangeStart', () => {...}) in angular 1 Commented Oct 9, 2016 at 23:41
  • 1
    please see here: stackoverflow.com/questions/33520043/… Commented Aug 3, 2017 at 12:11
  • 1
    Property 'subscribe' does not exist on type 'Location'. Commented Oct 28, 2017 at 18:05
  • That was changed AFAIR. BrowserLocation has it, but that was made private. developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/… should work or if you use the Angular router, it allows to subscribe to changes as well (see link in the question). Commented Oct 28, 2017 at 18:10
  • I was getting "Property subscribe does not exist.." because I missed the correct import: import {Location} from '@angular/common'; Commented Nov 20, 2018 at 15:59