0.1.4 • Published 7 years ago

angular-shortcut v0.1.4

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

Angular Shortcut

An angular shortcut system based of Zach Snow's blog post: http://zachsnow.com/#!/blog/2013/angularjs-shortcuts/

Shortcuts are english based rather than key codes so you don't have to keep looking them up.

Install

npm install angular-shortcut

In your app: angular.module('app', ['ng.shortcut'])

Usage

Can be used as a directive on any clickable item. <button ng-shortcut="'enter'" ng-shortcut-click></button>

Or anywhere else: <shortcut ng-shortcut="'enter'" ng-shortcut-action="someScopeMethod()"></shortcut>

It detaches with scope $destroy so you can use normal ng-if to enable/disable <shortcut ng-if="somethingIsEnabled" ng-shortcut="'enter'" ng-shortcut-action="someScopeMethod()"></shortcut>

Test

Not written yet.