In this post, we will discuss How to Use Modal Popups in Ionic’s latest version 4 in few easy steps. These modal popups are similar to pages with the only difference is these are loaded on above of current page.
In a similar manner, we can pass data to a Modal and also receive back response sent from Modal component. We will discuss these in the example below.
We will add open modal method with code to open Modal and pass out data to it with dismiss event handler.
In ModalExample component we will get data sent from Home component and show that data in Modal HTML. We will also have the closeModel method to return data response to Home component dismiss event.
That’s it now you have a working app with Ionic Modal in which we can pass data and also get the response back on Modal dismiss event.