title: What's the difference between $document and $window.document in Angular?
body: <p>I tried the following code in JSBin, the first one could get the canvas object. However, the second one cannot.</p>
  
  <p>JSBin: <a href="http://jsbin.com/natavejasa/1/edit?html,js,output" rel="noreferrer">http://jsbin.com/natavejasa/1/edit?html,js,output</a></p>
  
  <pre><code>var canvas = $window.document.getElementById('myCanvas');
  </code></pre>
  
  <p>JSBin: <a href="http://jsbin.com/yareb/1/edit?html,js,output" rel="noreferrer">http://jsbin.com/yareb/1/edit?html,js,output</a></p>
  
  <pre><code>var canvas = $document.getElementById('myCanvas');
  </code></pre>
  
  <p>So I'm wondering what's the difference between <code>$window.document</code> and <code>$document</code>.</p>