You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Location subscribe event does not fire on routing #10963
[X ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
I subscribe to URL change events via location.subscribe. The event never fires when I navigate via router-link clicks.
Expected/desired behavior
The event should fire.
Reproduction of the problem
Below code is from the root component that contains the router-outlet.
What is the expected behavior?
I should see "Location changed" in the console log when routing.
What is the motivation / use case for changing the behavior?
It is used in Angulartics: angulartics/angulartics2#46
Please tell us about your environment:
Angular version: 2.0.0-rc.X
2.0.0-rc.4
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Chrome
Activity
pkozlowski-opensource commentedon Aug 20, 2016
Could you please try to reproduce this in plunker with RC5, latest router and without any 3rd party libraries. My experience with
angulartics2so far was rather ... well, not great... and had to do work-arounds in one of my projects for the exact scenario you are rising: https://github.com/ng-bootstrap/ng-bootstrap/blob/master/demo/src/app/shared/angulartics2.workaround.tsIn any case, please provide a minimal reproduce scenario in rc5 so we are sure that we are dealing with the Angular issue here.
michalstepien commentedon Aug 21, 2016
@pkozlowski-opensource I create plnkr. http://plnkr.co/edit/WVX3gQPCZRgn52quxQay?p=preview
If click Heroes or details it doesn't work. If click back button in details it works (window.history.back();).
michalstepien commentedon Aug 21, 2016
Perhaps is related with this: #10909
JonnyBGod commentedon Sep 4, 2016
It looks like this problem persist in RC6.
It seems to work in test environment, following test works:
DzmitryShylovich commentedon Nov 12, 2016
can u provide a repro with the latest angular?
DmitryEfimenko commentedon Dec 14, 2017
This is still an issue in latest Angular: http://plnkr.co/edit/oDpsUKlgWTe84bu2cJUY?p=preview
alnvny commentedon Jun 2, 2019
does this issue fixed? I am still facing this.
kaito3desuyo commentedon Jun 8, 2019
I have same issue
samuelpetroline commentedon Sep 2, 2019
In the docs it says:
Subscribes to the platform's popState events.I guess it's not a bug, but a misunderstanding. It should be more clear to what event it's subscribing
angular-automatic-lock-bot commentedon Oct 3, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.