Unable to call ion will remove /ng on destroy using ionic 5

here i have sample project in which i am testing the ionic lifecycle in that i observed that i unable to call the ionic lifecycle hooks

ionViewWillLeave(),ionViewDidLeave(),ngOnDestroy()

below is my file structure

From tab1 page i am calling info page while calling i am unable to capture these events and after going to that page and when going back i unable to call ionic view enter, did enter hooks

In tab1.page.ts

ionViewWillLeave(){
   console.log('ion will leave');
 }

 ionViewDidLeave(){
   console.log('ion did leave');
 }
  ngOnDestroy(){
   console.log('seesion destroyed'); 
  }


  goToNav(){
    this.router.navigate(['/','info']);
  }

In app-routing.module.ts

  const routes: Routes = [
  {
    path: '',
    loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
  },
  {
    path: 'info',
    loadChildren: () => import('./user/info/info.module').then( m => m.InfoPageModule)
  }
];

note : after navigating to other page and when u i am navigating back to the tab page i unable to call any life cycle events

You aren’t supposed to be calling lifecycle events, and they should not be used to manage data freshness. See this post.

ok but if in tab 1 there is map with dynamic data and in the tab2 there login when user logs in again we have to show updated info in tab1 right for that we need to reload the data right

I don’t know enough about your overall design to say much more than “lifecycle events are not the droids you are looking for…find another way to convey changes in app-wide state to pages that care about them”. But given what you’ve just said, it does not sound like a great fit for tabs to me.

What I typically do is to have a logout button as part of a toolbar or FAB, and once the user logs out, the app navigates to the login screen. I can’t think of any situation in which having an omnipresent “login” tab would be warranted.