-
-
Notifications
You must be signed in to change notification settings - Fork 241
nativeScriptBootstrap should probably return a promise #156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm trying to use the promise, but it seems that it is never called.
The console prints "ANGULAR BOOTSTRAP DONE." and nothing else. |
@battistaar I'm pretty sure it works as I use it here. Which version of nativescript-angular are you using? I'll double check this evening to make sure. |
0.1.6 I'm not sure that's the problem, but according to the documentation "Any code after the start call will not be executed.". nativeScriptBootstrap calls application.start and it seems that everything I write after is not executed, either inside or outside the "then". |
Curious. Lucky I never read the documentation. That just raises more questions. Are you running it on IOS? I have not tried it there. I didn't escape work till just over an hour ago ... and so my response is much later than expected. Android:
Two console writes after the app promise:
It is the only place I have subscribing to the promise on the sample app I presume you end up with the same result? (from the nativescript samples http://docs.nativescript.org/angular/tutorial/ng-chapter-1) |
I did some tests and it seems that it's an iOS related problem, it works on android emulator |
I would create a new issue and copy this one in. |
Angular 2 bootstrap - returns
Promise<ComponentRef>
NativeScript's Angular2 bootstrap implementation - returns
Promise<ComponentRef>
NativeScript's nativeScriptBootstrap implementation returns
void
.I expect the sample projects and documentation will continue to prefer the
nativeScriptBootstrap
function to start the application. What I believe to be missing fromnativeScriptBootstrap
is that it should return aPromise<ComponentRef>
just as the bootstrap method does, which will make the following possible and add flexibility if needed:nativeScriptBootstrap(startComponent).then((appRef : ComponentRef) => {});
The text was updated successfully, but these errors were encountered: