Bird
0
0

Which Angular decorator is used to declare a component that uses FormsModule for template-driven forms?

easy🧠 Conceptual Q2 of 15
Angular - Template-Driven Forms
Which Angular decorator is used to declare a component that uses FormsModule for template-driven forms?
A@NgModule
B@Directive
C@Component
D@Injectable
Step-by-Step Solution
Solution:
  1. Step 1: Identify component decorator

    Angular components are declared with the @Component decorator, which defines templates and logic.
  2. Step 2: Understand FormsModule usage

    FormsModule is used inside component templates for forms, so the component must be decorated with @Component.
  3. Final Answer:

    @Component -> Option C
  4. Quick Check:

    Component decorator = @Component [OK]
Quick Trick: Use @Component to define components using FormsModule [OK]
Common Mistakes:
MISTAKES
  • Confusing @NgModule with component declaration
  • Using @Injectable for components
  • Mistaking @Directive for component decorator

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes