Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

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

$
0
0

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

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>