Skip to content

Commit

Permalink
fix(bootstrap): return promise and resolve ionicBootstrap
Browse files Browse the repository at this point in the history
Closes #7145
  • Loading branch information
adamdbradley committed Jul 2, 2016
1 parent da6215c commit aebdf2f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/components/nav/test/basic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,4 +417,6 @@ class E2EApp {
}
}

ionicBootstrap(E2EApp);
ionicBootstrap(E2EApp).then((componetRef) => {
console.log('ionicBootstrap', componetRef);
});
13 changes: 8 additions & 5 deletions src/config/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,14 @@ export function ionicBootstrap(appRootComponent: any, customProviders?: Array<an
let providers = ionicProviders(customProviders, config);
providers.push({provide: UserComponent, useValue: appRootComponent});

cssReady(() => {
// 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);
});
});
});
}
Expand Down

0 comments on commit aebdf2f

Please sign in to comment.