@Attribute

This is the documentation for Angular 6.
You can switch to the latest version Angular 7.

The @Attribute decorator returns the value of the specified attribute from the host.

Example

export class MyComponent {
  constructor(@Attribute('test') public test: string) { }
}

Will read value from declaration:

<my-component test="hello"></my-component>
Tutorials