Which Angular decorator is used to define a component's metadata?

  • @Component
  • @Directive
  • @Injectable
  • @NgModule
In Angular, the @Component decorator is used to define a component's metadata, including its selector, template, and other properties. This decorator is crucial for marking a TypeScript class as an Angular component. The other decorators mentioned are used for different purposes, such as defining modules, services, or custom directives.
Add your answer
Loading...

Leave a comment

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