Question presented to candidate: "With no AppModule, something still has to create the injector, run initializers and render the root component. Explain what bootstrapApplication actually does, in order, and how that differs from the old bootstrapModule path."
What a strong answer should cover:
- A platform injector is created (or reused) once per page; an environment (application) injector is created from the
ApplicationConfigproviders, with the platform injector as parent. - Angular prepends its own providers: browser essentials and the zoneless change detection setup, so a bare bootstrap uses
NoopNgZone. - Order: environment initializers run while the injector is set up, then app initializers (awaited), then the root component is created, change detection runs once, then bootstrap listeners fire.
ApplicationRef.bootstrap(Root)creates the rootComponentRefin the host element and the bootstrap Promise resolves with theApplicationRef.- Differences from
bootstrapModule: no NgModule class or module injector; providers come from a plain array. In v22 both paths are zoneless by default. - Version context: standalone APIs previewed in v14 and stable in v15; standalone by default in v19; zoneless by default in v21.
Clarifying questions expected:
- "Do you want the browser path only, or also how SSR passes a platform in?"
- "Should I cover change detection after bootstrap, or stop at the first render?"
Code / implementation expected: Optional — an instrumented appConfig that logs each bootstrap phase.