Host binding and Host listening
<p>How to use the host listener and host binding in angular 2?
I tried like the below for host listener, but it's always showing a <code>Declaration expected</code> error.</p>
<p>app.component.ts:</p>

<pre class="lang-ts prettyprint-override"><code>import {Component, EventEmitter, HostListener, Directive} from 'angular2/core';

@Directive({
    selector: 'button[counting]'
})

class HostSample {
    public click = new EventEmitter();
    @HostListener('click', ['$event.target']);
    onClickBtn(btn){
        alert('host listener');
    }
}

@Component({
    selector: 'test',
    template: '&lt;button counting&gt;&lt;/button&gt;',
    directives: [HostSample]
})

export class AppComponent {
   constructor(){
   }
}
</code></pre>