Bug Report
Ionic version:
ionic version
5.2.1
Current behavior:
When creating a modal screen and invoking it from a button enabled on the HomePage, when I press on the Home menu, instead of loading the HomePage, the PopupPage is loaded directly.
Expected behavior:
The HomePage page should load and display instead of PopupPage.
Steps to reproduce:
- ionic start myApp sidemenu
- ionic g page popup
- After the HomePape page card, we add
<ion-button color = "primary" (click) = "loadPopup ()"> Load popup
in home.page.html
In home.pase.ts:
public loadPopup() {
this.presentModal();
}
async presentModal() {
const modal = await this.modalController.create({
component: PopupPage
});
return await modal.present();
}
4. In home.module.ts we import PopupPageModule, as indicated in the documentation of ion-modal / ion-modal-controller (lazy loading):
import {PopupPageModule} from '../popup/popup.module';
and add PopupPageModule to imports array.
Now, clicking on the Home menu option, the PopupPage page is loaded, instead of HomePage.
Related code:
It is reproduced with the sample application that Ionic creates with sidemenu.
Other information:
Ionic info:
\myApp>ionic info
Ionic:
Ionic CLI : 5.2.1 (C:\Users\juanc\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.11.0
@angular-devkit/build-angular : 0.801.3
@angular-devkit/schematics : 8.1.3
@angular/cli : 8.1.3
@ionic/angular-toolkit : 2.0.0
Utility:
cordova-res : 0.6.0
native-run : 0.2.4
System:
NodeJS : v10.11.0 (C:\Program Files\nodejs\node.exe)
npm : 6.11.2
OS : Windows 10
Bug Report
Ionic version:
ionic version
5.2.1
Current behavior:
When creating a modal screen and invoking it from a button enabled on the HomePage, when I press on the Home menu, instead of loading the HomePage, the PopupPage is loaded directly.
Expected behavior:
The HomePage page should load and display instead of PopupPage.
Steps to reproduce:
<ion-button color = "primary" (click) = "loadPopup ()"> Load popup
in home.page.html
In home.pase.ts:
public loadPopup() {
this.presentModal();
}
async presentModal() {
const modal = await this.modalController.create({
component: PopupPage
});
return await modal.present();
}
4. In home.module.ts we import PopupPageModule, as indicated in the documentation of ion-modal / ion-modal-controller (lazy loading):
import {PopupPageModule} from '../popup/popup.module';
and add PopupPageModule to imports array.
Now, clicking on the Home menu option, the PopupPage page is loaded, instead of HomePage.
Related code:
It is reproduced with the sample application that Ionic creates with sidemenu.
Other information:
Ionic info:
\myApp>ionic info
Ionic:
Ionic CLI : 5.2.1 (C:\Users\juanc\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.11.0
@angular-devkit/build-angular : 0.801.3
@angular-devkit/schematics : 8.1.3
@angular/cli : 8.1.3
@ionic/angular-toolkit : 2.0.0
Utility:
cordova-res : 0.6.0
native-run : 0.2.4
System:
NodeJS : v10.11.0 (C:\Program Files\nodejs\node.exe)
npm : 6.11.2
OS : Windows 10