I am wondering how can I use @HostListener. The only info I\'ve found, was in the cheatsheet :
@HostListener
@HostListener(\'click\', [\'$event\']) onClick(e
The error message is quite accurate. A decorator is just for decorating a function (or a class, field, parameter, ...) Just put it before the code you want to decorate:
@HostListener('click', ['$event']) onClick(e) { console.log(e) }