Sei qui: Home Page -> Notes -> Tech -> What are decorators in Angular?

What are decorators in Angular?

Decorators in Angular are a way to add metadata to a class, its properties or methods. They are used to configure or modify the behavior of a class, its properties or methods. Decorators are a way to add functionality to the class without modifying its code. They are prefixed with the '@' symbol, and are implemented as functions.

There are several built-in decorators in Angular, such as:

  • @Component : used to define a component and its metadata
  • @Directive : used to define a directive and its metadata
  • @Injectable : used to define a service and its metadata
  • @Input : used to define an input property for a component
  • @Output : used to define an output property for a component


  • Decorators are a powerful feature of Angular, and allow for a clean and organized way to add functionality to a class. They are also extensible, meaning developers can create their own custom decorators to suit their specific needs.
    Sei qui: Home Page -> Notes -> Tech -> What are decorators in Angular?