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.
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 thekeyPress
handler in the specific modal you are dealing with and just call theclose
function which is passed to the controller, rather than closing them all.