Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
要制作一个典型的“返回顶部”链接,通常你会说,
<a id="top"></a> [...] <a href="#top">Top</a>
在 AngularJS 中,此链接尝试转到 example.com/#top,因此它返回到默认路由。你如何告诉角度适当地对待这个链接?
您将使用 $anchorScroll 服务。
http://docs.angularjs.org/api/ng.$anchorScroll