Angular2 directive, mouse movement event
<p>I want to know how I can trigger a directive function when moving or clicking the mouse on some object. </p>

<p>I found this part of code which I think will do what I want. I am not sure about the syntax and what is actually happening though.</p>

<p>As part of the directive class I have this:</p>

<pre><code>mousedown = new EventEmitter();
@HostListener('mousedown', ['$event'])
onMousedown(event) { 
    console.log(event); 
    this.mousedown.emit(event); 
}
</code></pre>

<p>Which, if I am clicking the div that has the directive, is printing the event to the console as expected. Although I am not sure on how the second line, <code>this.mousedown.emit()</code> is used.</p>

<p>What is actually called with the <code>.emit()</code> function?</p>