@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() {
    ...
  }
}
Tutorials