fix(bootstrap): return promise and resolve ionicBootstrap

Closes #7145
This commit is contained in:
Adam Bradley
2016-07-01 20:39:09 -05:00
parent da6215c08e
commit aebdf2f6e0
2 changed files with 11 additions and 6 deletions

View File

@ -417,4 +417,6 @@ class E2EApp {
} }
} }
ionicBootstrap(E2EApp); ionicBootstrap(E2EApp).then((componetRef) => {
console.log('ionicBootstrap', componetRef);
});

View File

@ -35,11 +35,14 @@ export function ionicBootstrap(appRootComponent: any, customProviders?: Array<an
let providers = ionicProviders(customProviders, config); let providers = ionicProviders(customProviders, config);
providers.push({provide: UserComponent, useValue: appRootComponent}); providers.push({provide: UserComponent, useValue: appRootComponent});
return new Promise((resolve) => {
cssReady(() => { cssReady(() => {
// call angular bootstrap // call angular bootstrap
bootstrap(AppRoot, providers).then(ngComponentRef => { bootstrap(AppRoot, providers).then(ngComponentRef => {
// ionic app has finished bootstrapping // ionic app has finished bootstrapping
ionicPostBootstrap(ngComponentRef); ionicPostBootstrap(ngComponentRef);
resolve(ngComponentRef);
});
}); });
}); });
} }