From aebdf2f6e0f11211ce1ecc9de9cf6604f8536182 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Fri, 1 Jul 2016 20:39:09 -0500 Subject: [PATCH] fix(bootstrap): return promise and resolve ionicBootstrap Closes #7145 --- src/components/nav/test/basic/index.ts | 4 +++- src/config/bootstrap.ts | 13 ++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/components/nav/test/basic/index.ts b/src/components/nav/test/basic/index.ts index 0fbe4bb4f8..2b675d2808 100644 --- a/src/components/nav/test/basic/index.ts +++ b/src/components/nav/test/basic/index.ts @@ -417,4 +417,6 @@ class E2EApp { } } -ionicBootstrap(E2EApp); +ionicBootstrap(E2EApp).then((componetRef) => { + console.log('ionicBootstrap', componetRef); +}); diff --git a/src/config/bootstrap.ts b/src/config/bootstrap.ts index 99f9f7e422..3375c86374 100644 --- a/src/config/bootstrap.ts +++ b/src/config/bootstrap.ts @@ -35,11 +35,14 @@ export function ionicBootstrap(appRootComponent: any, customProviders?: Array { - // call angular bootstrap - bootstrap(AppRoot, providers).then(ngComponentRef => { - // ionic app has finished bootstrapping - ionicPostBootstrap(ngComponentRef); + return new Promise((resolve) => { + cssReady(() => { + // call angular bootstrap + bootstrap(AppRoot, providers).then(ngComponentRef => { + // ionic app has finished bootstrapping + ionicPostBootstrap(ngComponentRef); + resolve(ngComponentRef); + }); }); }); }