Reputation: 797
To make a typical "Go back to top" link usually you would put, say
<a id="top"></a>
[...]
<a href="#top">Top</a>
In AngularJS this link tries to go to example.com/#top instead, therefore it goes back to the default route. How do you tell angular treat this link appropriately?
Upvotes: 1
Views: 1323
Reputation: 6629
You would use the $anchorScroll service.
http://docs.angularjs.org/api/ng.$anchorScroll
Upvotes: 3