The modal, to try and sum it up, is a way to step out of the normal flow of the app so the user can accomplish something prior to continuing on their way.
And the example for understanding:
For example, go to the Settings app → Mail → Add new account (all presented via a navigation hierarchy) - choose one of the providers and a “login page” is presented, modally. Once you fill it out and the whole thing is confirmed, the modal disappears and you are back to your account list. Another example is in the Calendar app, when you add an event, which takes you out of the process of viewing events, the view is presented modally - when you go to assign a calendar, however, the view is presented hierarchically.
I was asking myself this same question because I tend to favor modals, and was wondering if there is a difference in terms of memory or whats still loaded. If I open a modal, I’m assuming all pages are still open, is the same true when you push a page?
Better don’t mix them up. NavController and ModalController both have a different navigation stack. If you push to a new page inside a modal, it lands on the ModalController-Stack. If you open a modal in a new modal, that modal is pushed to the ModalController-Stack and does not create a new stack. Usually I use modal only for specific features that are not the main tasks of the app like login or presenting a feedback form. I try to prevent navigation inside of a modal. Better use pages over modals. Modals don’t really have a benefit over pages.
Regarding the history of your navigation stack, all pages will stay open as long as you don’t modify your nav stack or use something like setRoot or popToRoot. But if you are in a modal and push pages to the stack, these get pushed on the nav stack of the modal controller. I assume that when you close the modal, these pages will get removed to.
I don’t generally use navigation within a modal. But what if I have a form? I’m never sure if I should use a modal or a page but I guess there is really no correct answer
If the form is part of your workflow, for example creating a new recipe in a cooking app, then I would recommend a page over a modal. Wikipedia says it is an interaction blocking dialog.
Ionic component documentation says: Modals slide in off screen to display a temporary UI, often used for login or signup pages, message composition, and option selection.
Its api documentation says: Usually it is used for making a choice or editing an item.
you are asking on an older post. Explain a little bit more what you want to get.
If you wanna see a modal in action, then look to the docs https://beta.ionicframework.com/docs/api/modal
ion-modal component is a flexible ui modal, where action sheet, etc also ui modals but for more specific scenarios.
Maybe that helps, otherwise give us a more specific question.