Which decorator is used to declare a class as an Angular component?

  • @Component
  • @Directive
  • @Injectable
  • @NgModule
The @Component decorator is used to declare a class as an Angular component. Components are the fundamental building blocks of Angular applications, representing user interface elements. NgModule is used to define modules, @Directive is used for custom directives, and @Injectable is used for dependency injection, but they are not used to declare components.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *