DEV Community

Closing a modal with the back button in Ionic 5 / Angular 9

Nicolus on May 17, 2020

I'm going to share this because it took me a couple hours of research and experimenting to achieve something that in my opinion should be the defau...
Collapse
 
nicolus profile image
Nicolus • Edited

Oh yeah I forgot to mention : The best solution is probably not to use modals in the first place 😉

Collapse
 
tayambamwanza profile image
Tayamba Mwanza

Is this one a joke or is there an argument for this?

Collapse
 
nerdenvironment profile image
nerdenvironment

Hi I was having one question, when modals will be destroyed, it will create a forward button and what if we don't wanna show anything on that forward button click, it will just add a state in our history and we have click back button twice in order to go back to original page.

Collapse
 
thisdotmedia_staff profile image
This Dot Media

Thanks for breaking it down and saving us time Nicolas! Much appreciated 😊👐🏻

Collapse
 
jeffestrong profile image
jeffestrong

Thank you so much for this implementation, you saved my day!

Collapse
 
tayambamwanza profile image
Tayamba Mwanza

Thank you so much for this! Smooth as butter.

Collapse
 
healmah profile image
HealMah

I have NO SINGLE DOUBT, that you are sent from ABOVE, Thanks Man!