AngularJS document.ready 在使用 ng-view 时不起作用 [英] AngularJS document.ready doesn't work when using ng-view
问题描述
在我的应用程序中的多个路由之间导航时,angularJS 中的 document.ready 出现问题.它仅在我使用 ctrl+f5(页面重新加载)时有效;似乎在页面之间导航不会将文档状态更改为就绪.
控制器
angular.element(document).ready(function() {window.scrollTo(0,90);});
主 html 文件
<html ng-app="myApp"><头><meta http-equiv="content-type" content="text/html;charset=utf-8"/><title></title>头部><身体><div class="容器"><div ng-view></div>