title: How to access iframe by id in AngularJS?
body: <p>How can I get reference of the iframe element with AngularJS ?</p>
  
  <pre><code>&lt;div&gt;
     &lt;iframe id="myframe" ...&gt;
  &lt;/div&gt;
  
  
  mycontroller.$inject = ['$document'];
  
  function mycontroller ($document) {
      console.log($document.getElementById("myframe")); //always null
  }
  </code></pre>
  
  <p>I can see the iframe, but the reference lookup always prints null. Why?</p>