angular-hotkeys
angular-hotkeys copied to clipboard
Allow use hotkey directive as shorcut to click element
Like this:
<button ng-click="doSomething()" hotkey="ctrl+q">
Why? :
-
Today, it is writing like this:
<button ng-click="doSomething()" hotkey="{'ctrl+q': doSomething}">
-
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}">
+1 i need this too
+1
+1
+1