1

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.

Khurshid Ansari
  • 4,638
  • 2
  • 33
  • 52
To_Mars
  • 125
  • 4
  • 12

1 Answers1

1

Well, use this way to pass data using navCtrl:

where you want to send/pass id/param put id here on the app-routing.module.ts file

{ path: 'studentedit/:sid', loadChildren: './studentedit/studentedit.module#StudentEditPageModule'},

then in html file

<h1 (click)="gotoUpdate(std.studentID)" >click</h1>

in page.ts file

gotoProductlist(studentID: string) {
  this.navCtrl.navigateForward('/studentUpdate/' + studentID);
}

in Edit Page

ngOnInit() {
   // Get the ID that was passed with the URL
   let id = this.activatedroute.snapshot.paramMap.get('sid');
}

here get id from another page. Please use your page name and data name.

hope it helps you :)

user9088454
  • 1,076
  • 1
  • 15
  • 45