Bird
0
0

Which decorator property is used to specify an external template file in an Angular component?

easy📝 Conceptual Q2 of 15
Angular - Components
Which decorator property is used to specify an external template file in an Angular component?
Atemplate
BtemplateUrl
CstyleUrls
Dstyles
Step-by-Step Solution
Solution:
  1. Step 1: Recall Angular component decorator properties

    The @Component decorator uses 'template' for inline HTML and 'templateUrl' for external files.
  2. Step 2: Match property to external template

    'templateUrl' points to an external HTML file for the component's template.
  3. Final Answer:

    templateUrl -> Option B
  4. Quick Check:

    External template property = templateUrl [OK]
Quick Trick: Use templateUrl for external HTML files [OK]
Common Mistakes:
  • Using 'template' for external files
  • Confusing styleUrls with templateUrl
  • Using 'styles' instead of template properties

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes