Jerome Ansia Jerome Ansia - 9 months ago 139
AngularJS Question

Angular, onLoad function on an iFrame

I have this iframe working with basic JavaScript:

<iframe id="upload_iframe" name="upload_iframe" onLoad="uploadDone();"></iframe>


Which triggers the method
uploadDone();
when the content of the iframe has been loaded.

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.

Answer Source

try defining the function within controller as:

window.uploadDone=function(){
  /* have access to $scope here*/
}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download