chieffancypants / angular-hotkeys

Configuration-centric keyboard shortcuts for your Angular apps.
http://chieffancypants.github.io/angular-hotkeys/
MIT License
1.68k stars 248 forks source link

Add hotkey shorcut click element in directive. close #197 #198

Open AbraaoAlves opened 8 years ago

AbraaoAlves commented 8 years ago

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

javisperez commented 8 years ago

+1