$anchorScroll按照官方文档的示例gotoBottom,我对 angular有疑问。单击后goToBottm,$anchorScroll将添加到url位置ID的 - mysite.com/tag/##ID,在第一次加载时它工作正常,但是当refershing页面ID停留在末尾时url,滚动不起作用。有想法该怎么解决这个吗?我的代码: HTML:
<button ng-click = "addRow(); gotoBottom()">add row </button>
和身份证:
<table id = "bottom">
...
</table>
gotoBottom 在我的controller:
$scope.gotoBottom = function() {
// set the location.hash to the id of
// the element you wish to scroll to.
$location.hash('bottom');
// call $anchorScroll()
$anchorScroll();
};