Ionic 2 ion-navbar Back with parameters

Hi All,

I have a page with an ion-navbar, when I navigate to the next page I use the following:

this.nav.push(SubCategoryPage, {
employeeModel: this.employeeModel
});

It passes the param parameter successfully to the next page.

When I am in the next page (SubCategoryPage), I update the parameter object (employeeModel). My question is, when I click the back arrow to return to the previous page, how do I pass the modified parameter object (employeeModel) back?

When back is clicked, the ngOnDestroy is called, do I use this, but then how do I pass the parameter object?

OR, is there some other scope I should put the object in? (How do you pass objects from one page to another, including back?) What’s best practice?

Thanks

I’ve tried declaring the object (employeeModel) as a provider. It is accessible, with no errors. But it looses any values I set on it.

I have a Master/Detail set up, when I go to the Detail, I set properties on the object, but when I return to the Master via the back button, the object does not have the properties. I go back to the Detail, and the properties are also absent.

SOLVED:

in app.ts I need to set the object, then it is shared between pages

ionicBootstrap(MyApp, [EmployeeModel]);

ref: https://www.joshmorony.com/an-in-depth-explanation-of-providers-in-ionic-2/