@HostBinding

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

Options

hostPropertyName#

hostPropertyName?: string

Property name.