ionVIewWillEnter are not trigger after pop the page in ionic3?


#1

Hello to all,
I have pass the data to previous page data is properly sent but after pop ionViewWillEnter are not trigger and i also using ionViewDidEnter but it is working?
`
ionViewWillEnter() {
this.selectSubCategoryForFilter(this.selectedCategoryId);
}

     self.navCtrl.pop();
 	   //used for pass the data into another pag
      	self.navCtrl.getPrevious().data.selectedCategoryId  = self.selectedCategoryKeyId;

#2

That is unmaintainable spaghetti. Use mutually injected service providers or NavParams for exchanging data amongst pages instead.


#3

sir what is spaghetti?


#4

Ave, Caesar, morituri te salutant
The last words from the roman empire, before it wents under. sir what is spaghetti?
That is so funny.

As rapropos said: There a 2 common ways passing data to a page. As NavParams or with a provider.

Imho, if you want collect data from different pages, that should be used from an other page, it personnally will prefer a shared provider. In a life cycle hook you canb update your page.

Best regards from a galic village.


#5

use “ionViewDidEnter” instead “ionViewWillEnter”


#6

sir same result ionViewDidEnter not trigger after pop?


#7

ionViewDidEnter run anytime you enter a page.
If its not work for you, you may doing something wrong


#8

Worrying about which lifecycle event to use with this disastrous design is simply rearranging deck chairs on the Titanic. Write a service provider already.


#9

Sir in my case it will be trigger only once time?


#10

Please add code of the 2 pages

  1. page you doing “pop()”
  2. page with “ionViewDidEnter”