The Issue:
I've been unable to to accept a modal window with the ENTER key
I have modified the default Plunker to show you what I've done since now --> Here
What I have:
Briefly, the ENTER key is recognized by the modal, but it doesn't trigger my function (scope issues, I suspect).
The bad part is that I had to modifiy the template/modal/window
, which I would gladly left unspoiled, if possible.
What I would love
I would love to simply put the ng-enter
directive in my modal, without modifying the default template
Extra
I've also tried to add the "event 13" to the modal
directive, but I couldn't pass any result in the modal.close
, so I dropped that road
Any thought?
Check my Plunker. You should add ng-enter to "OK" button.
<button class="btn btn-primary" ng-enter="ok();" ng-click="ok()">OK</button>
Maybe you are looking for something more generic, I'm not sure. Then you might consider watchers. But personally I find this better since we don't have any constant watcher which listens modal event.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With