title: pass mouseevent to component onclick
body: <p>I'm trying to capture mouse coordinates in a Angular component.</p>
  
  <p>Here is the html in question:</p>
  
  <pre><code>&lt;div id="container" class="fullSize" style="height:100%;" (click)="onClick(ev)"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Here is the component function in the corresponding typescript file:</p>
  
  <pre><code>onClick( ev : MouseEvent ) {
    console.log("x:" + ev.clientX);
  }
  </code></pre>
  
  <p>And the error in the console:</p>
  
  <pre><code>Cannot read property 'clientX' of undefined'
  </code></pre>
  
  <p>What would be the correct way of passing that MouseEvent to my component function?</p>