Bird
0
0

Which import statement correctly imports the Injectable decorator from Angular core?

easy📝 Conceptual Q2 of 15
Angular - Standalone Components
Which import statement correctly imports the Injectable decorator from Angular core?
Aimport { Injectable } from '@angular/core';
Bimport Injectable from '@angular/common';
Cimport { Injectable } from '@angular/forms';
Dimport Injectable from '@angular/platform-browser';
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct Angular package for Injectable

    The Injectable decorator is part of '@angular/core'.
  2. Step 2: Check syntax correctness

    Correct syntax uses curly braces for named imports: import { Injectable } from '@angular/core';
  3. Final Answer:

    import { Injectable } from '@angular/core'; -> Option A
  4. Quick Check:

    Injectable import = '@angular/core' [OK]
Quick Trick: Use curly braces for named imports from '@angular/core' [OK]
Common Mistakes:
  • Using default import syntax for named exports
  • Importing from wrong Angular packages

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes