In my ionic 3 projects, I have a function, where I have to push a page, here I want to pass a value, like a user ID and get this value in another page. How can I pass variable and get value when push a page in ionic 3?
I am followed this code:
MyFunction(user_id){
MyFunction(user_id){ this.navCtrl.push(PrivateChatPage); }
Apply this code to Send Value:
FunctionName(user_id){ this.navCtrl.push(PrivateChatPage,{user_id:user_id}); }
Apply this code to Receive value:
constructor(public navCtrl: NavController, public navParams: NavParams) { this.receiver_id = navParams.get('receiver_id'); console.log("receiver_id"); console.log(this.receiver_id); }
Question and answer is powered by AnsPress.io