@HostBinding
This is the documentation for Angular 6.
You can switch to the latest version Angular 10.
You can switch to the latest version Angular 10.
Binds a host element property to a directive/component property.
Example
export class MyComponent {
@HostBinding('class.valid') isValid;
}
Or use getter for binding:
export class MyComponent {
@HostBinding('class.error') get isError() {
...
}
}
Links & Tutorials