角JS NG-视图渲染事件 [英] Angular js ng-view rendered event
本文介绍了角JS NG-视图渲染事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何才能知道什么时候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
这篇关于角JS NG-视图渲染事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文