How do you pass data to a previous view?


#1

I have a page that I need to select the contacts to send a message to. I understand how I can add a new page, and pass data to it. But after I’ve selected contacts on the next page, I need to send that information back to the previous page. How would I do this? From the documentation it looks like you can only pass information when you push onto the navController.


#2

Hey!

  1. You can use ModalControllerto search and select contact. It has onDidDismiss from which you can get data.
  2. You can use service to share data
  3. You can trigger custom Events

#3

If you want to pass data on a navController.pop, the solution proposed by @aaronksaunders works very well


#4

I like this solution too. I definitely use this in the future. The modal controller best fits my needs for now, but the callback is great solution too.