Bird
0
0

What will Angular do when executing the following bootstrap code?

medium📝 Predict Output Q4 of 15
Angular - Fundamentals
What will Angular do when executing the following bootstrap code?
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';

bootstrapApplication(AppComponent);
AIt compiles <code>AppComponent</code> but does not render it
BIt throws an error because <code>AppComponent</code> is not a module
CIt creates and inserts <code>AppComponent</code> as the root component in the DOM
DIt bootstraps the entire application module containing <code>AppComponent</code>
Step-by-Step Solution
Solution:
  1. Step 1: Call bootstrapApplication

    This function bootstraps a standalone component as the root.
  2. Step 2: Insert AppComponent

    Angular creates and inserts AppComponent into the DOM.
  3. Final Answer:

    It creates and inserts AppComponent as the root component in the DOM -> Option C
  4. Quick Check:

    bootstrapApplication inserts root component [OK]
Quick Trick: bootstrapApplication inserts the root component [OK]
Common Mistakes:
  • Confusing standalone components with modules
  • Expecting compilation without rendering

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes