Ionic version:
[x] 4.x
Current behavior:
Modal page shows up even when not presented.
Expected behavior:
Modal page should only show up when presented.
Steps to reproduce:
Here's a repo: https://github.com/YDrogen/capacitor-issue-android-modal (Don't mind the repo name - bug might not come from Capacitor)
ng serveOPEN MODAL - Ionic asks to add ModalPage to entryComponentsentryComponents: [ModalPage] from app/home/home.module.tsOPEN MODAL - It works!Component ModalPage is not part of any NgModule or the module has not been imported into your module.ModalPageModule from app/home/home.module.tsIonic info:
Ionic:
ionic (Ionic CLI) : 4.3.1 (C:\Users\YDrogen\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.0.0-rc.1
@angular-devkit/build-angular : 0.11.4
@angular-devkit/schematics : 7.1.4
@angular/cli : 7.1.4
@ionic/angular-toolkit : 1.2.2
System:
NodeJS : v8.9.1 (C:\Program Files\nodejs\node.exe)
npm : 6.5.0
OS : Windows 10
@YDrogen modal.module.ts can't have router.
https://github.com/YDrogen/capacitor-issue-android-modal/blob/master/src/app/modal/modal.module.ts#L10-L15
You should remove RouterModule.forChild(routes) .
Yep, because you are overwriting the forChild Routes of your home.page.module.
Both Modules have a default route to path: ''.
Thanks guys for finding the issue :) So this issue will be closed
Thanks! Been on this issue for a while, I didn't knew that it would override, I just used ionic generate for these modals and didn't found any documentation about this!
Sorry for the inconvenience!
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.
Most helpful comment
@YDrogen modal.module.ts can't have router.
https://github.com/YDrogen/capacitor-issue-android-modal/blob/master/src/app/modal/modal.module.ts#L10-L15
You should remove
RouterModule.forChild(routes).