dwmkerr / angular-modal-service

Modal service for AngularJS - supports creating popups and modals via a service.
MIT License
626 stars 321 forks source link

Any option to close the modal with keyboard escape? #196

Closed DvirH closed 7 years ago

dwmkerr commented 7 years ago

Yep, please see this in the sample:

https://github.com/dwmkerr/angular-modal-service/blob/master/samples/sampleapp.js#L61

In this case it closes all modals with the * key, easy to adapt to Escape. Better is to have the keyPress handler in the specific modal you are dealing with and just call the close function which is passed to the controller, rather than closing them all.