I'm using Uikit with Angularjs and i need create possibly a directive that prevent the closing of the Modal when i press esc button. I tried with this way:
mainApp.directive('ngEsc', function () {
return function (scope, element, attrs) {
element.bind("keydown keypress keyup", function (event) {
if(event.which === 27) {
event.preventDefault();
}
});
};
});
And then put the directive on the modal
Test modalBut it still closes. Is there any other way?