angular-hotkeys icon indicating copy to clipboard operation
angular-hotkeys copied to clipboard

Allow use hotkey directive as shorcut to click element

Open AbraaoAlves opened this issue 9 years ago • 4 comments

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}"> 
    

AbraaoAlves avatar Jan 06 '16 15:01 AbraaoAlves

+1 i need this too

javisperez avatar Jan 08 '16 16:01 javisperez

+1

alisonmonteiro avatar Jan 08 '16 22:01 alisonmonteiro

+1

ythecombinator avatar Jan 10 '16 04:01 ythecombinator

+1

raczynskil avatar Jan 16 '16 14:01 raczynskil