Utilizing @HostBinding
to connect the results of a function to the host element's visible attribute:
@HostBinding('attr.visible')
private get visibleAttr(): any {
return this._visible ? '' : null;
}
The name of the function appears unnecessary as it will never be invoked by anything else. I attempted to define it as an anonymous lambda function but encountered issues:
@HostBinding('attr.visible') (() => {
return this._visible ? '' : null;
})
Is there a method to declare this function anonymously, or at least using a lambda? Or does Angular framework require it to have a specific name?