-
-
Notifications
You must be signed in to change notification settings - Fork 241
<router-outlet> as root element route to invisible component #1439
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
@liuwei108 - thank you for your question - indeed the matter needs some clarification in the documentation. What is happening here is that when we are using However, this is not the case for
As the solution is in fact, the expected behavour I am going to explicitly add a note in the related documentation section Side notes about
|
Documentation note added via this PR |
Hello Nick, Thanks for explanation.
works fine within normal page navigation, but has problems when put in modal page navigation.
in page modal main component, it works first time I open the modal, but if I open modal second time and navigate from one modal comp to another, an error occur:
Is this also expected behavior? Thanks! |
@liuwei108 this seems like a bug - if possible please provide a sample project or Playground that can reproduce the issue. |
Hello Nick, Please check https://play.nativescript.org/?template=play-ng&id=H6aK0A&v=4 If I change modal.component.html
to
There are no problem. |
Guess this should be in a separate issue, so I raised a new issue for it #1452 |
@liuwei108 closing this issue as it seems the main question is answered here - I will post my answer related to the modal navigation in the newly opened issue |
Make sure to check the existing issues in this repository
Checked
If there is no issue for your problem, tell us about it
I decide to not using page-router-outlet and change to use angular's router-outlet due to the nav cache problem mentioned in #374
So I changed
<page-router-outlet></page-router-outlet>
to<router-outlet></router-outlet>
in app.component.html, and I got an error.By searching bugs here, I found #1384 match it and the solution is to add "{ createFrameOnBootstrap: true }" in main.ts. I did that, and my main.ts now look like this:
platformNativeScriptDynamic({ createFrameOnBootstrap: true }).bootstrapModule(AppModule);
Then no error appear and the app started. I have 2 component: Home and About
If I click a button in HOME to route to ABOUT component, the ABOUT page doesn't show any thing. by tracking the ngOnInit method, I can see the About Comp did imitated, just invisible.
I found a workaround, that is wrap the
<router-outlet></router-outlet>
in a stack layout, like this:I believe this should be a bug, can any one like into this? Thanks!
Which platform(s) does your issue occur on?
Occurs in all platform
Please, provide the following version numbers that your issue occurs with:
tns --version
4.1.2
Please, tell us how to recreate the issue in as much detail as possible.
Describe the steps to reproduce it.
Is there any code involved?
Please check code sample in
router-outlet-route-to-empty-page
The text was updated successfully, but these errors were encountered: