# ionViewWillEnter is not triggering on tabs

**URL:** <https://forum.ionicframework.com/t/ionviewwillenter-is-not-triggering-on-tabs/235420>\
**Category:** Ionic Angular\
**Created:** [August 7, 2023, 12:31pm UTC](https://forum.ionicframework.com/t/ionviewwillenter-is-not-triggering-on-tabs/235420 "2023-08-07T12:31:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fedoraus](https://avatars.discourse-cdn.com/v4/letter/f/ec9cab/32.png) [@fedoraus](https://forum.ionicframework.com/u/fedoraus)\
**Post date:** [August 7, 2023, 12:31pm UTC](https://forum.ionicframework.com/t/ionviewwillenter-is-not-triggering-on-tabs/235420/1 "2023-08-07T12:31:15Z")

</div>

hello there, im using ionic angular for my mobile app, i created page for tabs, unitab.page.ts, there is the unitab-routing-module.ts

```auto
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { UnitabPage } from './unitab.page';
import { DvirPageModule } from '../dvir/dvir.module';
import { DvirPage } from '../dvir/dvir.page';

const routes: Routes = [
  {
    path: '',
    component: UnitabPage,
    children: [
      {
        path: 'hos',
        loadChildren: () =>
          import('../hos/hos.module').then((m) => m.HosPageModule),
      },
      {
        path: 'dvir',
        component: DvirPage,
      },
      {
        path: 'inspection',
        loadChildren: () =>
          import('../inspection/inspection.module').then(
            (m) => m.InspectionPageModule
          ),
      },
      {
        path: 'others',
        loadChildren: () =>
          import('../others/others.module').then((m) => m.OthersPageModule),
      },
      {
        path: '',
        redirectTo: '/unitab/hos',
        pathMatch: 'full',
      },
    ],
  },
  {
    path: '',
    redirectTo: '/unitab/hos',
    pathMatch: 'full',
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class UnitabPageRoutingModule {}

```

the problem is that on dvir page I move to edit-dvir page, make some changes, and when I save and use `this.navCtrl.navigateBack('/unitab/dvir');`, on dvir page doesn’t trigger either ngOnInit, ionViewWillEnter, ionViewDidEnter, but at the same time, in unitab page ts ngOninit is working, what could be the problem and how to solve it?  
I need to trigger ionViewWillEnter, when i navigateBack to it not by clicking tabs, but using this.navCtrl.navigateForward(‘/insert-dvir’);

sorry for my English, hope u understood me!

---

<div class="post-metadata">

**Author:** ![mohammeddanish247](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@mohammeddanish247](https://forum.ionicframework.com/u/mohammeddanish247)\
**Post date:** [August 8, 2023, 11:53am UTC](https://forum.ionicframework.com/t/ionviewwillenter-is-not-triggering-on-tabs/235420/2 "2023-08-08T11:53:33Z")

</div>

yah, you can achive this scenario by using the route params in the your components.ts file here is the code it will trigger when ever come back to this page.

import { Router, ActivatedRoute } from “@angular/router”;  
import { Subscription } from “rxjs”;

paramsSubscription: Subscription;

constructor(private route : ActivatedRoute){}

ngOnInit() {  
console.log(‘inside on-init’);  
this.paramsSubscription = this.route.params.subscribe(params=\>{  
console.log(‘inside on-init again’);  
// it will trigger when ever come back to this page  
});  
}
