想知道当所有指令都完成编译/链接时,检测页面加载/引导完成的最佳方法是什么.
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完成加载后发送事件
发布评论