title: How to trigger ionViewWillLeave in Ionic 4 with route in tabs.router.module
body: <p>Lifecycle hooks <code>ionViewWillLeave</code> / <code>ionViewDidLeave</code> are not triggered when placing all pages routes in TabsPageRoutingModule.</p>
  
  <p>We changed the routes from <code>app-routing.module.ts</code> to <code>tabs.router.module.ts</code> to get full view of the tabbar in the Ionic 4 app. The routes works perfectly.<br>
  When the routes were in <code>app-routing.module.ts</code>, the <code>ionViewWillLeave</code> was always triggered when leaving the page (and closing the present <code>Observables</code>). Now the <code>ionViewWillLeave</code> is not triggered when leaving the page.</p>
  
  <p><strong>Route in tabs.router.module.ts</strong></p>
  
  <pre><code>const routes: Routes = [
    {
      path: 'tabs',
      component: TabsPage,
      children: [
        {
          path: '',
          redirectTo: '/tabs/(home:home)',
          pathMatch: 'full',
        },
        {
          path: 'home',
          outlet: 'home',
          component: HomePage
        },
        {
          path: 'chats',
          outlet: 'chats',
          component: ChatsPage
        },
  ...
  </code></pre>
  
  <p><strong>Logging failed for ionViewWillLeave in TS file</strong></p>
  
  <pre><code>ionViewWillEnter() {
    console.log('ionViewWillEnter');  // &lt;- In console when entering
  }
  ionViewWillLeave() {
    console.log('ionViewWillLeave');  // &lt;- Not in console when leaving
  }
  </code></pre>
  
  <p>Can't figure out why the <code>ionViewWillLeave</code> is not printed anymore. Any help is appreciated.<br><br></p>
  
  <hr>
  
  <p><strong>Route in app-routing.module.ts</strong></p>
  
  <pre><code>const routes: Routes = [
    { path: '', loadChildren: './tabs/tabs.module#TabsPageModule' },
    { path: 'chats', loadChildren: './chats.module#ChatsPageModule' },
  ...
  </code></pre>
  
  <p><strong>Logging success for ionViewWillLeave in TS file</strong></p>
  
  <pre><code>ionViewWillEnter() {
    console.log('ionViewWillEnter');  // &lt;- In console when entering
  }
  ionViewWillLeave() {
    console.log('ionViewWillLeave');  // &lt;- In console when leaving
  }
  </code></pre>