在一个iFrame的角度,功能的onLoad [英] Angular, onLoad function on an iFrame
本文介绍了在一个iFrame的角度,功能的onLoad的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这样的iframe基本JavaScript的工作:
I have this iframe working with basic JavaScript:
<iframe id="upload_iframe" name="upload_iframe" onLoad="uploadDone();"></iframe>
这会触发方法 uploadDone();
时iframe的内容加载
Which triggers the method uploadDone();
when the content of the iframe has been loaded.
我如何做同样的事情在角?我想打电话给控制器时的iframe装载的功能,但我还没有看到一个 NG-的onload
为止。
How do I do the same thing in Angular?. I want to call a function on the controller when the iframe loads, but I haven't seen a ng-onload
so far.
推荐答案
尝试控制器中定义的功能:
try defining the function within controller as:
window.uploadDone=function(){
/* have access to $scope here*/
}
这篇关于在一个iFrame的角度,功能的onLoad的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文