The @Attribute decorator is one of the least known and least used, but in some cases, it can bring a performance boost to the application.

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

Let’s say that we have a core button component that accepts the type , which can be primary or secondary.

And because it is a static string, we will use it in the template without the brackets.

There is one drawback to this approach. Because we are using an Input() , Angular will still create a binding for the type property and will check it with every change detection cycle, even though this is a static string.

To illustrate this, let’s see the compiled code.