When creating a custom attribute directive, which decorator is used to define its metadata?

  • @Component
  • @Directive
  • @Attribute
  • @Metadata
In Angular, to create a custom attribute directive, you use the @Directive decorator to define its metadata. This decorator allows you to specify the selector, inputs, outputs, and other properties that determine how the directive behaves when applied to elements in the DOM. The other options, such as @Component, @Attribute, and @Metadata, are not typically used for creating attribute directives.
Add your answer
Loading...

Leave a comment

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