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.
Loading...
Related Quiz
- For optimizing performance in large lists where data is immutable, one should use the ChangeDetectionStrategy.______ strategy.
- In which scenario would you use the updateOn option with a value of 'blur' for a FormControl?
- What is the primary difference between single-slot and multi-slot content projection?
- When creating a shared service that should retain state and be available for all components, the service should be provided in _____.
- You are building an e-commerce application. On the product page, you want to have tabs for "Details", "Reviews", and "Related Products", each being a separate route. How would you structure this in Angular?