Bird
0
0

What does the selector property in the @Component decorator specify?

easy📝 Conceptual Q2 of 15
Angular - Components
What does the selector property in the @Component decorator specify?
AThe CSS class applied to the component
BThe name of the component class
CThe file path of the component's template
DThe HTML tag used to insert the component
Step-by-Step Solution
Solution:
  1. Step 1: Identify the role of selector

    The selector defines the custom HTML tag that Angular recognizes to render this component.
  2. Step 2: Differentiate from other properties

    It is not a CSS class, file path, or class name but the tag name used in HTML templates.
  3. Final Answer:

    The HTML tag used to insert the component -> Option D
  4. Quick Check:

    Selector = HTML tag for component [OK]
Quick Trick: Selector is the component's custom HTML tag [OK]
Common Mistakes:
  • Thinking selector is a CSS class
  • Confusing selector with template or style paths

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes