Bird
0
0

Identify the issue in this Angular bootstrap code:

medium📝 Debug Q7 of 15
Angular - Fundamentals
Identify the issue in this Angular bootstrap code:
import { bootstrapModule } from '@angular/platform-browser';
import { AppModule } from './app.module';

bootstrapModule(AppModule);
AbootstrapModule requires an additional argument for providers
BAppModule must be a standalone component, not a module
CThe function should be platformBrowserDynamic().bootstrapModule instead of bootstrapModule
DThe import path '@angular/platform-browser' is correct for bootstrapModule
Step-by-Step Solution
Solution:
  1. Step 1: Check import source

    bootstrapModule is not exported from '@angular/platform-browser'.
  2. Step 2: Use platformBrowserDynamic

    The correct method is platformBrowserDynamic().bootstrapModule(AppModule).
  3. Final Answer:

    The function should be platformBrowserDynamic().bootstrapModule instead of bootstrapModule -> Option C
  4. Quick Check:

    Use platformBrowserDynamic for module bootstrapping [OK]
Quick Trick: Use platformBrowserDynamic().bootstrapModule for modules [OK]
Common Mistakes:
  • Importing bootstrapModule from wrong package
  • Confusing standalone component bootstrap with module bootstrap

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes