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;
That is unmaintainable spaghetti. Use mutually injected service providers or NavParams
for exchanging data amongst pages instead.
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.
use “ionViewDidEnter” instead “ionViewWillEnter”
sir same result ionViewDidEnter not trigger after pop?
ionViewDidEnter run anytime you enter a page.
If its not work for you, you may doing something wrong
Worrying about which lifecycle event to use with this disastrous design is simply rearranging deck chairs on the Titanic. Write a service provider already.
1 Like
Sir in my case it will be trigger only once time?
Please add code of the 2 pages
- page you doing “pop()”
- page with “ionViewDidEnter”