How to handle click events with @Directive in angular2? : <p>Is it possible to attach click events to the element on or within a directive? (not component) For example.. I have a directive defined as follows:</p>

<pre><code>import { Directive, OnInit, Input, ElementRef, Renderer } from '@angular/core';
declare var $: any; // JQuery

@Directive({
    selector: '[gridStack]'
})
export class GridStackDirective implements OnInit {
    @Input() w: number;
    @Input() animate: boolean;

    constructor(
        private el: ElementRef,
        private renderer: Renderer
    ) {
        renderer.setElementAttribute(el.nativeElement, "class", "grid-stack");
    }

    ngOnInit() {
        let renderer = this.renderer;
        let nativeElement = this.el.nativeElement;
        let animate: string = this.animate ? "yes" : "no";

        renderer.setElementAttribute(nativeElement, "data-gs-width", String(this.w));
        if(animate == "yes") {
            renderer.setElementAttribute(nativeElement, "data-gs-animate", animate);
        }

        let options = {
            cellHeight: 80,
            verticalMargin: 10
        };

        // TODO: listen to an event here instead of just waiting for the time to expire
        setTimeout(function () {
            $('.grid-stack').gridstack(options);
        }, 300);
    }

}
</code></pre>

<p>In the html where I use that directive (index.html, note that I do not have any template associated with the @directive itself, can I include a click event?:</p>

<pre><code>&lt;div gridStack&gt;
&lt;div&gt;&lt;a (click)="clickEvent()"&gt;Click Here&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>I know this works if it is a component, but am looking to try to get it working with a directive if it is possible.</p>
