Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bolasblack/ng-kbd
https://github.com/bolasblack/ng-kbd
Last synced: 11 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/bolasblack/ng-kbd
- Owner: bolasblack
- Created: 2015-05-19T01:40:16.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-05-19T01:45:04.000Z (over 9 years ago)
- Last Synced: 2024-11-10T03:36:32.500Z (2 months ago)
- Language: CoffeeScript
- Size: 117 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ng-kbd
[Mousetrap](https://craig.is/killing/mice) wrapper for [angular.js](https://www.angularjs.org/) to handling keyboard shortcuts in scope.
## Install
```bash
bower install bolasblack/ng-kbd --save
# Or
npm install bolasblack/ng-kbd --save
```## Usage
```javascript
angular.module('app', [])// You can inject `$kbd` in controller
.controller('TestController', ['$kbd', ($kbd) ->
// Call all method of Mousetrap instance
$kbd.bind
$kbd.trigger// When scope destroyed, the event listener will be removed
])
```## Running Tests
```bash
npm install
npm test
```