Ionic 4 pass data between pages, how i can do?


#1

hi guys, i need help. before i pass data with this method:

        this.navCtrl.push(UserSettingsPage, { userConfiguration: this.userConfiguration})

and in the other page i get the data with navparams:

this.userConfiguration = this.navParams.get('userConfiguration')

now i can’t because navcontrol is changed.

i need to pass data with the new navControl:

this.navCtrl.navigateForward('user-settings')

but i don’t know how get the data in the other page.


#2

in page.ts

gonewpage() {
let data= JSON.stringify(this.data);
this.router.navigate([’/newpage’, data]);
}
app-routing:
{ path: ‘newpage/:data’, loadChildren: ‘./newpage/newpage.module#newpagePageModule’ },

we are sending data from current page to next page