angular-hotkeys
angular-hotkeys copied to clipboard
Add hotkey shorcut click element in directive. close #197
Allow use hotkey like this:
<!-- Press "ctrl+q" to trigger click and 'doSomething()' -->
<button ng-click="doSomething()" hotkey="ctrl+q">
<!-- If element is disabled, handler is not triggered -->
<button ng-click="doSomething()" hotkey="ctrl+q" ng-disabled="expression">
[note]: this PR put event.preventDefault in click event, assuming that ng-click is present. Fixes #197
+1