Angularjs Angular$anchorScroll yOffset未生效

Angularjs Angular$anchorScroll yOffset未生效,angularjs,anchor-scroll,Angularjs,Anchor Scroll,这可能有点多余,但我已经查看了stackoverflow上处理anchorScroll中YOffset的一些项目,我已经复制了这些掠夺物,但我的应用程序仍然无法工作。我的应用程序中有很多控制器(目前大约15个),设置如下: var app = angular.module('myapp', []) .run(['$anchorScroll', function($anchorScroll) { $anchorScroll.yOffset = 50; }]) ... .contro

这可能有点多余,但我已经查看了stackoverflow上处理anchorScroll中YOffset的一些项目,我已经复制了这些掠夺物,但我的应用程序仍然无法工作。我的应用程序中有很多控制器(目前大约15个),设置如下:

var app = angular.module('myapp', [])

.run(['$anchorScroll', function($anchorScroll) {
  $anchorScroll.yOffset = 50;   
}])

...

.controller('blabla', function($scope, $http, $location, $anchorScroll) {
// this is the only controller that uses anchorScroll

  $scope.gotoPub = function(pub_nid) {
    var final_hash = 'n' + pub_nid;
    $location.hash(final_hash);
    $anchorScroll();
};

现在,无论我在“run”方法中将yOffset设置为什么,可能是5000、50、10000等等,它对实际的滚动绝对没有影响。。。有没有什么明显的事情表明我做错了

谢谢!!
-你找到问题所在了吗?