title: Why is ElementRef to Canvas not working here?
body: <p>I try to load an image into a canvas.</p>
  
  <p><strong>In the template</strong></p>
  
  <pre><code>&lt;canvas #myca id="mycanvas" style="width: 600px; height; 600px; border: 2px red solid;" (mousedown)="mdown ($event)"&gt;&lt;/canvas&gt;
  </code></pre>
  
  <p><strong>In the component</strong></p>
  
  <pre><code>@ViewChild('myca', {static: false}) myca: ElementRef &lt;HTMLCanvasElement&gt;;
  
  ngOnInit ()
  {
      // ctx by id works!
      //var ctx = (&lt;HTMLCanvasElement&gt; document.getElementById('mycanvas')).getContext('2d'); 
  
      // ctx by ElementRef fails!
      var ctx = this.myca.nativeElement.getContext('2d'); 
  
      var img1 = new Image();
      img1.src = "http://any_img_you_want.jpg";
  
      img1.onload = function () 
      {
          ctx.drawImage (img1, 0, 0);
      }
  }
  </code></pre>
  
  <p>If I get the ctx by the id it works. If I do it by the ElementRef it fails.
  Whats the problem here?</p>