Skip to content

Router navigation does not works in APP_INITIALIZER:"^6.1.0 angular version & ^4.2.0 nativescript version" #1498

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
hannandesai opened this issue Aug 24, 2018 · 1 comment

Comments

@hannandesai
Copy link

hannandesai commented Aug 24, 2018

Hello,

In our app, in APP_INITIALIZER function, we navigate to particular page based on user login or not. If user is login than we redirect to main application page otherwise redirect to registration page.

"WE CANNOT USE ANY DELAYED PROMISES IN OUR APP_INITIALIZER"

But after upgrading to NativeScript v4.2 and NativeScript-Angular v6.1.0, the redirection to a correct screen has stopped working in APP_INITIALIZER. It simply shows a white screen. However, it does not give any error. If we check in router.navigation promise than also it will go into a success part. It will struck on some blank page. 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,
Hannan

@NickIliev
Copy link

Related to #1487 - closing as duplicate

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