Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

$location should not intercept #links (in html4 mode) #772

Closed
vojtajina opened this issue Mar 8, 2012 · 7 comments
Closed

$location should not intercept #links (in html4 mode) #772

vojtajina opened this issue Mar 8, 2012 · 7 comments
Assignees
Milestone

Comments

@vojtajina
Copy link
Contributor

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).

@IgorMinar
Copy link
Contributor

I think you meant html5 mode and not html4.

@jeffbcross
Copy link
Contributor

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.

@jeffbcross jeffbcross added this to the 1.3.x milestone Feb 4, 2014
@carlosrymer
Copy link

+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.

@caitp
Copy link
Contributor

caitp commented Aug 7, 2014

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

@btford btford removed the gh: issue label Aug 20, 2014
@IgorMinar
Copy link
Contributor

this appears fixed in rc.2: http://plnkr.co/edit/wRUtn9MxeYUczVfkgc46?p=preview

@IgorMinar IgorMinar modified the milestones: 1.3.0-rc.5, 1.3.0 Sep 30, 2014
@IgorMinar
Copy link
Contributor

@caitp can you please verify that plunker is doing the right thing and close this?

@caitp
Copy link
Contributor

caitp commented Oct 1, 2014

http://plnkr.co/edit/1X7PLVAHSO7QK1zutsou?p=preview slightly updated to ensure location is instantiated --- yeah looks fixed. I think this was fixed by 2294880

@caitp caitp closed this as completed Oct 1, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants