I have an application tabs whit 4 Tabs, and each tab shows some data according to a configuration. The page have a header that contains a popover component with the settings option on it. After the user set some configuration on settings and back to some tab page, that page must refresh the content.
I am using the ionViewDidEnter or ionViewWillEnter lifecycle events and check if the previous settings have been changed but the event hasn't been being catch, only when I change to other tab page.
Tab page A
export class HomePage implements OnInit {
ionViewDidEnter(){
if(this.client.doClientChanged(this.clientName)){
console.log("changed");
}
else{
console.log("not changed");
}
}
ionViewWillEnter(){
console.log("test")
}
}
Header component
export class PrimeHeaderComponent {
constructor(public popoverCtrl: PopoverController) {}
presentPopover(event: any) {
let popover = this.popoverCtrl.create(MenuPage);
popover.present({
ev: event
});
}
}
Popover Component
export class MenuPage {
constructor(
public viewCtrl: ViewController, private navCtrl: NavController) {}
openConfig(){
this.navCtrl.push(ConfigPage);
}
}
When I chose the configuration, I back to the previous page that still shows the popover, and when I dismiss the popover, nothing happen with the lifecycle events.