Bird
0
0

Find the mistake in this standalone component bootstrapping:

medium📝 Debug Q7 of 15
Angular - Standalone Components
Find the mistake in this standalone component bootstrapping:
import { bootstrapApplication } from '@angular/platform-browser';
import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  template: `

Hi

`, standalone: false }) export class AppComponent {} bootstrapApplication(AppComponent);
ATemplate syntax is wrong
BSelector name is invalid
CbootstrapApplication cannot bootstrap components
Dstandalone property must be true for standalone components
Step-by-Step Solution
Solution:
  1. Step 1: Check standalone property

    For standalone components, standalone must be set to true.
  2. Step 2: Identify incorrect value

    Here, standalone: false is incorrect and causes bootstrapping failure.
  3. Final Answer:

    standalone property must be true for standalone components -> Option D
  4. Quick Check:

    Standalone components require standalone: true [OK]
Quick Trick: Set standalone: true for standalone components [OK]
Common Mistakes:
  • Setting standalone to false
  • Confusing selector with standalone flag
  • Assuming bootstrapApplication needs NgModule

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes