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