如何才能知道什么时候NG-视图完全呈现。目前,我曾尝试使用
$范围。在$('$ viewContentLoaded',函数(){}$范围。在('$ routeChangeSuccess',函数(){} $angular.element(文件)。就绪(函数(){}
但所有这些观点被渲染之前触发。
解决方案正如我在注释中,使用的onload
中的 NG-视图
How can I know when ng-view is completely rendered. Currently I have tried to use
$scope.$on('$viewContentLoaded', function() { }
$scope.$on('$routeChangeSuccess', function() { }
angular.element(document).ready(function() { }
but all these are firing before view is rendered.
解决方案As I mentioned in the comment, use the onload
argument of the ng-view directive