我有一个用 ngCloak 指令用 Angular 编写的网页。它加载在动态大小的 iframe 中, pym.js .
问题是,除非我调整浏览器大小或触发调整大小事件,或者在页面加载后调用 pymChild.sendHeight() ,否则页面不会显示。
不过,我没有看到任何与 ngCloak 相关的事件。是否有“页面已渲染, Controller 已初始化”的 Angular 事件?
最佳答案
有$timeout服务:
$timeout(function() {
// this code will execute after the render phase
});
关于angularjs - 在 Angular 初始化结束时执行代码,并显示ngCloak,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24827873/