MCPcopy Index your code
hub / github.com/angular/angular / ngDoBootstrap

Method ngDoBootstrap

packages/examples/core/ts/platform/platform.ts:43–51  ·  view source on GitHub ↗
(appRef: ApplicationRef)

Source from the content-addressed store, hash-verified

41export class AppModule implements DoBootstrap {
42 // #docregion componentSelector
43 ngDoBootstrap(appRef: ApplicationRef) {
44 this.fetchDataFromApi().then((componentName: string) => {
45 if (componentName === 'ComponentOne') {
46 appRef.bootstrap(ComponentOne);
47 } else {
48 appRef.bootstrap(ComponentTwo);
49 }
50 });
51 }
52 // #enddocregion
53
54 fetchDataFromApi(): Promise<string> {

Callers

nothing calls this directly

Calls 3

fetchDataFromApiMethod · 0.95
thenMethod · 0.65
bootstrapMethod · 0.45

Tested by

no test coverage detected