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.
Loading...
Related Quiz
- The process of retrieving previous navigation details, such as the previously visited route, can be achieved using router.________ in Angular.
- If two modules provide the same service and are imported into a third module, the service from the ________ module will be used.
- Which of the following is the primary building block of an Angular application?
- How can Angular's AOT compilation reduce the size of the final JavaScript bundle?
- To apply multiple structural directives to one element, you would typically use ________.