Skip to content

APP_INITIALIZER doesn't allow navigation in "nativescript-angular": "^6.1.0" version #1493

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

Closed
Disha-Modi opened this issue Aug 22, 2018 · 2 comments

Comments

@Disha-Modi
Copy link

Hello,

In our app, we check whether the user is already logged in or not on App Startup. If the user is already logged in, then we redirect him to the Dashboard screen of our app, otherwise we redirect him to the login screen. We used to perform this check in APP_INITIALIZER.

But after upgrading to NativeScript v4.2 and NativeScript-Angular v6.1.0, the redirection to a correct screen has stopped working using APP_INITIALIZER. It simply shows a white screen. The sample code can be found on the following URL:
https://play.nativescript.org/?template=play-ng&id=Z16l6O&v=6

Can you please check and let us know whether the latest version supports navigation using APP_INITIALIZER or not? If not, then which alternative should we use to redirect the user to an appropriate screen after app startup?

Thanks in anticipation...
Regards,
Disha.

@tsonevn
Copy link
Contributor

tsonevn commented Aug 22, 2018

Duplicate of #1487

@tsonevn tsonevn marked this as a duplicate of #1487 Aug 22, 2018
@tsonevn tsonevn closed this as completed Aug 22, 2018
@Disha-Modi
Copy link
Author

Hello, tsonevn
We can not use any delayed promises in our APP_INITIALIZER, we just simply need to route to a particular page based on user login or not. So,this issue is still open, can you please refer it once properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants