Push a page, on close of that page return data back to previous page

Hi,

i have 2 pages. On 1st page the users click an add icon that pushes the 2nd. The 2nd page contains an input with a save button, upon clicking the save button, the 2nd page should close and 1st page reappear returning with the value of the input from the 2nd page.

1st page.

  addItem() {

    this.navCtrl.push(2ndpage);

  }

2nd page

    save() {

        //this.viewCtrl.dismiss(this.item);

    }

After clicking the save function it should dismiss the 2nd page how would i return with this.item object. ( how would this work if page was not a modal).

Why don’t you want the second page to be a modal? Sounds like a textbook use case for modals.

This is an example I did a while back making use of a provider to hold temporary values and making use of the ionViewDidEnter() callback.