Bird
0
0

What is wrong with this component selector definition? selector: 'app component'

medium📝 Debug Q6 of 15
Angular - Components
What is wrong with this component selector definition? selector: 'app component'
ASelector must start with a capital letter.
BSelector contains a space which is invalid in Angular selectors.
CSelector cannot contain the word 'component'.
DSelector must be enclosed in square brackets.
Step-by-Step Solution
Solution:
  1. Step 1: Check selector syntax rules

    Angular selectors must be valid CSS selectors; spaces are not allowed in tag or attribute selectors.
  2. Step 2: Analyze the given selector

    The selector 'app component' has a space, making it invalid. Other options are incorrect rules.
  3. Final Answer:

    Selector contains a space which is invalid in Angular selectors. -> Option B
  4. Quick Check:

    Spaces not allowed in selectors [OK]
Quick Trick: No spaces allowed in selectors [OK]
Common Mistakes:
  • Thinking spaces are allowed in selectors
  • Assuming selector must start uppercase

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes