Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49523

How to return data from modals to viewController without only calling the dismiss()

$
0
0

@karabillie wrote:

// myPage.ts
// Passing data to the modal:
let modal = Modal.create(myModal, { data: [...] });

// Getting data from the modal:
modal.onDismiss(data => {
    console.log('MODAL DATA', data);
});
// myModal.ts
constructor(inputData: NavParams, private view: ViewController) {
    // Getting data from the page:
    var dataFromPage = inputData.get('data');
}

dismiss() {
    // Returning data from the modal:
    this.view.dismiss(
        // Whatever should be returned, e.g.:
        // { ... }
    );
}

Hi. I implemented the code seen from this post Ionic Modal don't return data. How to return data from ionic modals?, which work perfectly.

I have now the exact problem. I want to send the data from the modal to the viewControllew without calling the dimiss() method. the problem is specifically when I click the back button in android devices, where I want my data to be sent even if i press the back button. How to achieve this?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49523

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>