简体   繁体   中英

Ionic2: Send params between pages (When clicking on the return nav button) using navParam

Does anyone know how returns a simple value (or JSON ) by clicking on the nav return button on ionic2? I know that navParam is able to send a value on push , but I didn't find anything about the pop action and connect the return nav button to my new pop action.

There is a open feature request about back navigation with parameters.

One solution is to pass a Promise through NavParams:

Parent

new Promise((resolve, reject) => {
  this.nav.push(ChildPage, {resolve: resolve});
}).then(data => {
  // process data
});

Child

this.navParams.get('resolve')('some data');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM