Skip to content

Commit aebdf2f

Browse files
committed
fix(bootstrap): return promise and resolve ionicBootstrap
Closes #7145
1 parent da6215c commit aebdf2f

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/components/nav/test/basic/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,4 +417,6 @@ class E2EApp {
417417
}
418418
}
419419

420-
ionicBootstrap(E2EApp);
420+
ionicBootstrap(E2EApp).then((componetRef) => {
421+
console.log('ionicBootstrap', componetRef);
422+
});

src/config/bootstrap.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,14 @@ export function ionicBootstrap(appRootComponent: any, customProviders?: Array<an
3535
let providers = ionicProviders(customProviders, config);
3636
providers.push({provide: UserComponent, useValue: appRootComponent});
3737

38-
cssReady(() => {
39-
// call angular bootstrap
40-
bootstrap(AppRoot, providers).then(ngComponentRef => {
41-
// ionic app has finished bootstrapping
42-
ionicPostBootstrap(ngComponentRef);
38+
return new Promise((resolve) => {
39+
cssReady(() => {
40+
// call angular bootstrap
41+
bootstrap(AppRoot, providers).then(ngComponentRef => {
42+
// ionic app has finished bootstrapping
43+
ionicPostBootstrap(ngComponentRef);
44+
resolve(ngComponentRef);
45+
});
4346
});
4447
});
4548
}

0 commit comments

Comments
 (0)