How do you enable the escape key close functionality in a IONIC modal?


I know this isn’t much useful on mobile but I use the app extensively on web browser also. so please help me how can i make it close the modal by clicking the escape button ?

Only way i can think of is wiring javascript if clicked esc button number fire the close button on click.

I wonder if anythign written in the modal itself.