How to send navparams get to provider and get in other page?

Hello, I want to send navparams get data to my provider and get in other page.

My page : rental.ts

My provider : share.ts

How to resolve this ? thank you.


Use preformatted text icon to insert code instead of pictures. It is better readable.

I guess you have imported your ShareService correctly.
You have injected it in the constructor with
public service: ShareService

Now you can use it like anything else you have injected via constructor

this.service.kategori_user = this.....

maybe I think to simple.

Best reagards, anna-liebt

Thank you for your answer, but still not work.

I do not get your requirement correctly. But I guess you want to pass data to another page.
Two ways,
You can send data when opening the next page like this,
this.navCtrl.push('NextPage', {data1: data1, data2: data2, data3: data3});

Or you can use a service.
Set data before opening the page

this.sharedPageDataService.data1 = data1;
this.sharedPageDataService.data2 = data2;

then get data from the next page

this.data1 = this.sharedPageDataService.data1;
this.data2 = this.sharedPageDataService.data2;

You can even create a method in the service to push data to an array and and clear when some page gets data.