AngularJS完成加载后发送事件

编程入门 行业动态 更新时间:2024-10-04 11:15:54
本文介绍了AngularJS完成加载后发送事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

想知道当所有指令都完成编译/链接时,检测页面加载/引导完成的最佳方法是什么.

Wondered what's the best way to detect the finish of page loading/bootstrapping, when all directives done compiling/linking.

已经有任何活动吗?我应该重载引导程序功能吗?

Any event already there? Should I overload the bootstrap function?

推荐答案

Angular没有提供一种在页面加载完成时发出信号的方法,可能是因为完成"取决于您的应用程序.例如,如果您具有层次结构的局部树,则其中一个会加载其他树. 完成"表示所有文件都已加载.任何框架都将很难分析您的代码并理解一切都已完成或仍在等待.为此,您必须提供特定于应用程序的逻辑以进行检查和确定.

Angular hasn't provided a way to signal when a page finished loading, maybe because "finished" depends on your application. For example, if you have hierarchical tree of partials, one loading the others. "Finish" would mean that all of them have been loaded. Any framework would have a hard time analyzing your code and understanding that everything is done, or still waited upon. For that, you would have to provide application-specific logic to check and determine that.

更多推荐

AngularJS完成加载后发送事件

本文发布于:2023-11-26 23:17:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1635611.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:加载   事件   AngularJS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!