-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Error using multiple @IonicPage and setting rootPage by name #12136
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
Tried to create a plunker to reproduce, but looks like IonicPage don't work over plunker, the error is "Invalid link: First Page". |
Found that this isn't a bug. As explained by @ChezRD on #11703, the PageModule and Page should NOT be declared on our top component (AppComponent). I've read the docs many times to find something that I was doing wrong, and didn't found. The documentation isn't clear about it: @IonicPage is a form to LazyLoad the pages. I really think that the documentation should be clearer about this functionality, since as @ChezRD said, many issues was opened about this. |
Hello, thanks for using Ionic! This is something that we are already tracking and are currently working on a fix that should be in the next release. |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Ionic version: (check one with "x")
[ ] 1.x (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[ ] 2.x
[x] 3.x
I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior:
Cannot set rootPage using page's name (as string), only if I reference to the component itself.
Expected behavior:
It's expected to work as documented.
I need to be able to do:
Steps to reproduce:
Using latest ionic version:
ionic start bug
- Choose sidemenu, use or not cordova don't change the bug.ionic g page FirstPage
ionic g page SecondPage
imports
imports
app.component@openPage
, and replace it content with:this.nav.setRoot('FirstPage');
You will see the error:
app.module.ts
and commentSecondPageModule
.Related code:
Other information:
Ionic info: (run
ionic info
from a terminal/cmd prompt and paste output below):The text was updated successfully, but these errors were encountered: