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

Allow use hotkey directive as shorcut to click element #197

Open AbraaoAlves opened 8 years ago

AbraaoAlves commented 8 years ago

Like this:

<button ng-click="doSomething()" hotkey="ctrl+q"> 

Why? :

  1. Today, it is writing like this:

    <button ng-click="doSomething()" hotkey="{'ctrl+q': doSomething}"> 
  2. Besides of code duplication and verbose syntax, we have to manage click availability problem inside code, for example:

    <!-- click not trigger when 'expression' is true, but with hotkey still working! -->
    <button ng-click="doSomething()" ng-disabled="expression" hotkey="{'ctrl+q': doSomething}"> 
javisperez commented 8 years ago

+1 i need this too

alisonmonteiro commented 8 years ago

+1

ythecombinator commented 8 years ago

+1

raczynskil commented 8 years ago

+1