How can I pass the data of home(page 1) to ContactPage(page 3) along with DetailsPage(page 2) data?
lets say
HomePage has data of “UserId”
DetailsPage has data of “UserName” & “UserAddress” //this page does not have UserID
now how can i get the data of
“UserId” as well as “UserName & UserAddress” on ContactPage?
This can be done using navCtrl.push()
1.In page 1 (homePage) while passing to page two (DetailsPage) use
this.navCtrl.push(‘DetailsPage’,{userID:your userId})
2.in page 2 (DetailsPage)in constructor: this.userId:this.navparams.get(‘userID’)
and while passing to 3rd page(3rd page) add your userId as an another param in navCtrl.push
IN your 2nd page: this.navCtrl.push(‘3rdpage name’, {‘userId’:this.userId, ’ “UserName” : your UN :“UserAddress”: your User adress’})
3.In your third page:
this.userId=this.navparams.get('userId');
this.userName=this.navparams.get('userName');
this.userAddress=this.navparams.get('userAddress');
Umm…
I can pass the data from Page1 to page 2 via NavParams but my question is how can i pass data from page 1 & page 2 to page 3? Because in between page 2 the data gets changed
Thank You So Much It worked and saved alot of time