-
Notifications
You must be signed in to change notification settings - Fork 27.4k
$location should not intercept #links (in html4 mode) #772
Comments
I think you meant html5 mode and not html4. |
Plunkr reproducing the issue: http://plnkr.co/edit/5VtAKKwqRBHkPL4L7aPc?p=preview Clicking on anchor should just go to the text at the bottom of the page, but it is also routed to the /anchor route, despite html5mode being set to true. |
+1, I've had a case where in the controller I have to check $location.hash to see if anything is there and then programmatically scroll the user to the location of interest. |
There's a PR for this, here's a working demo http://plnkr.co/edit/WVPYzaXOKujcb5vSbvJz?p=preview It's not perfect (it only works for relative hash fragment links), but it's a good start |
this appears fixed in rc.2: http://plnkr.co/edit/wRUtn9MxeYUczVfkgc46?p=preview |
@caitp can you please verify that plunker is doing the right thing and close this? |
http://plnkr.co/edit/1X7PLVAHSO7QK1zutsou?p=preview slightly updated to ensure location is instantiated --- yeah looks fixed. I think this was fixed by 2294880 |
So that clicking on hash link navigates to anchor, even if the url did not changed (hash was already set to the value).
Or maybe even better, $anchorScroll might intercept the links as well (as well as watching location).
(that might work even on old browsers, where hashbang urls are used).
The text was updated successfully, but these errors were encountered: