Hi,
I’d like to give the users the possibility to navigate to a page from a list OR a popover menu.
The navigation from the list works great (I push the page and pass the item I clicked on).
However, when navigating to the page from the popover doesn’t (I push the page from the Popover & pass a default item).
I’m on page A; I click on the dots in the toolbar, the Popover shows up, I click on “Go To Another Page”.
What I want to happen is load that page.
What’s happening is that page loads, but freezes.
When I remove the html code from that page I want to open; it still shows… very strange… and it still freezes.
I’ve notice the ngInit of the Page I’m trying to open is called Twice.
=> that could explain why the page is still showing, despite the html code being removed (the empty html is the top layer, the cached one is below??).
I present the popover to which I pass a data object from Page A.
presentPopover(event){
let popover = this.popoverCtrl.create(PopoverPage, data);
popover.present({
ev: event
});
}
Here’s the Popover Component.
@Component({
template: `
<ion-list>
<ion-list-header>Settings</ion-list-header>
<button ion-item (click)="goTo()">Go To Another Page</button>
</ion-list>`
})
export class PopoverPage {
constructor(
private nav: NavController){}
)}
goTo(){
this.nav.push(PageToGoTo, data);
this.close();
}
Thanks for your help