In my meanderings around the world wide interweb, and now especially the angular.io style docs, I find many references to @HostBinding
and @HostListener
One thing that adds confusion to this subject is the idea of decorators is not made very clear, and when we consider something like...
@HostBinding('attr.something')
get something() {
return this.somethingElse;
}
It works, because it is a get accessor. You couldn't use a function equivalent:
@HostBinding('attr.something')
something() {
return this.somethingElse;
}
Otherwise, the benefit of using @HostBinding
is it assures change detection is run when the bound value changes.