Bird
0
0

Why might an Angular component with selector selector: 'app-item' not render when used as <App-Item></App-Item> in HTML?

hard📝 Conceptual Q10 of 15
Angular - Components
Why might an Angular component with selector selector: 'app-item' not render when used as <App-Item></App-Item> in HTML?
AAngular does not support custom tags with hyphens.
BThe component selector must be used as an attribute, not a tag.
CAngular selectors are case-sensitive and must match exactly in lowercase.
DThe component selector must be enclosed in square brackets.
Step-by-Step Solution
Solution:
  1. Step 1: Recall case sensitivity in selectors

    Angular selectors are case-sensitive and usually lowercase to match HTML standards.
  2. Step 2: Analyze usage

    Using <App-Item> with uppercase letters does not match 'app-item' selector, so Angular won't render it.
  3. Final Answer:

    Angular selectors are case-sensitive and must match exactly in lowercase. -> Option C
  4. Quick Check:

    Selector case sensitivity matters [OK]
Quick Trick: Match selector case exactly in HTML [OK]
Common Mistakes:
  • Ignoring case sensitivity in selectors
  • Assuming Angular ignores tag case

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes