Angular - ComponentsWhat 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.Check Answer
Step-by-Step SolutionSolution:Step 1: Check selector syntax rulesAngular selectors must be valid CSS selectors; spaces are not allowed in tag or attribute selectors.Step 2: Analyze the given selectorThe selector 'app component' has a space, making it invalid. Other options are incorrect rules.Final Answer:Selector contains a space which is invalid in Angular selectors. -> Option BQuick Check:Spaces not allowed in selectors [OK]Quick Trick: No spaces allowed in selectors [OK]Common Mistakes:Thinking spaces are allowed in selectorsAssuming selector must start uppercase
Master "Components" in Angular9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallPerf
More Angular Quizzes Angular Fundamentals - How Angular bootstraps an application - Quiz 5medium Component Interaction - @ContentChild and content projection - Quiz 2easy Directives - Directive execution and DOM manipulation - Quiz 11easy Lifecycle Hooks - ngDoCheck for custom change detection - Quiz 13medium Lifecycle Hooks - ngOnDestroy for cleanup - Quiz 13medium Pipes - Parameterized pipes - Quiz 12easy Pipes - Parameterized pipes - Quiz 15hard Templates and Data Binding - Two-way binding with ngModel - Quiz 1easy Templates and Data Binding - Interpolation with double curly braces - Quiz 15hard Templates and Data Binding - Why data binding matters - Quiz 11easy