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.
Loading...
Related Quiz
- For a router link to get an "active" CSS class when the link's route is active, you can use the ________ directive.
- For configuring proxies during development to bypass CORS issues, you'd modify the ______ file in an Angular CLI project.
- What is the default change detection strategy in Angular?
- How can you pre-fetch a lazily loaded module so that it's immediately available when the user needs it?
- Your application has a dynamic form where fields can be added or removed based on user input. Which feature of Angular's Reactive Forms would you leverage to accomplish this?