How to pass data from 1 page to another using navigation in Ionic 4?

       let navigationExtras: NavigationExtras = {
          state: {
            user:p,
            shopid:this.shopid,
            section:this.section,
          } 
        };
       this.navCtrl.navigateForward(['personprofile'], navigationExtras);

RECEIVE SECOND PAGE

this.route.queryParams.subscribe((params) => {
let navParams = this.router.getCurrentNavigation().extras.state;
console.log(navParams);
});

Hi peter,
I’m using this option and it works but since it’s async, the data will be undefined outside of the function. I don’t want to put the rest of my code all in this function either. How to solve it? thx.

What I would do is use injected service providers to transfer data between pages, not the router. That way you can expose an Observable in the provider, and subscribe to it in each page that cares.

Many thanks for your help. I will do it like that!

thanks a lot, this was so helpful. but i’ve been trying to add entering animation but it doesn’t work