title: Get onload event of an angular.element iframe
body: <p>I am trying to get an onload event on an added iframe. This happens inside a service function call. Its supposed to download a file, what works fine. But I need to wait until the iframe is loaded to return a promise resolve.
  The reduced code with the problem is:</p>
  
  <pre><code>iFrame = angular.element('&lt;iframe id="blaba" style=\'position:fixed;display:none;top:-1px;left:-1px;\'/&gt;')
  angular.element(document.body).append iFrame
  # onload bind here
  iFrame.attr('src', url)
  </code></pre>
  
  <p>I tried it with </p>
  
  <pre><code>iFrame.onload = -&gt;      
    $log.info 'iframe loaded'
  </code></pre>
  
  <p>Also</p>
  
  <pre><code>iFrame.on 'load', (event) -&gt;
    $log.info 'iframe loaded'
  </code></pre>
  
  <p>I also tried to select the Iframe via its id and bind the load event on that. But also doesn't work.
  Any ideas or suggestions?</p>
  
  <p>best regards </p>