@HostBinding and @HostListener: what do they do and what are they for?

A quick tip that helps me remember what they do –

HostBinding('value') myValue; is exactly the same as [value]="myValue"

And

HostListener('click') myClick(){ } is exactly the same as (click)="myClick()"


HostBinding and HostListener are written in directives
and the other ones (...) and [..] are written inside templates (of components).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)