Bird
0
0

Why does this Angular component not render? Selector: selector: '[appBadge]', usage: <appBadge></appBadge>

medium📝 Debug Q7 of 15
Angular - Components
Why does this Angular component not render? Selector: selector: '[appBadge]', usage: <appBadge></appBadge>
AThe selector is an attribute selector but used as an element tag
BThe selector name is invalid because it contains uppercase letters
CAngular does not support attribute selectors
DThe component is missing a template
Step-by-Step Solution
Solution:
  1. Step 1: Identify selector type

    The selector [appBadge] means it must be used as an attribute.
  2. Step 2: Check usage

    Using <appBadge> treats it as an element, which does not match the attribute selector.
  3. Final Answer:

    The selector is an attribute selector but used as an element tag -> Option A
  4. Quick Check:

    Attribute selectors must be used as attributes, not elements [OK]
Quick Trick: Attribute selectors require attribute usage, not element tags [OK]
Common Mistakes:
  • Using attribute selectors as element tags
  • Confusing selector syntax
  • Ignoring case sensitivity (not relevant here)

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes