Skip to content

the-darc/angular-mousetrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

angular-mousetrap-service

npm version Bower version

AngularJS Wrapper for mousetrap.js whithout registering it in the global scope.

How to use

  1. Install angular-mousetrap-service.
    Using bower: bower install --save angular-mousetrap-service
    Or, using npm: npm install --save angular-mousetrap-service

  2. Include angular-mousetrap-service into your project.

    <script src="angular-mousetrap-service.min.js"></script>
  3. Add angular-mousetrap module in the dependencies of a angular module:

    angular.module('exampleApp', ['angular-mousetrap'])
  4. Inject the Mousetrap service into a controller, a directive, etc:

    .controller('ExampleCtrl', ['$scope','Mousetrap', function($scope, Mousetrap){
    	Mousetrap.bind('ctrl+s', function() {
    		//...
    	});
    }]);

Obs.: See the Demo page for pratical real example.

How to contribute

I am very glad to see this project living with pull requests.

LICENSE

Copyright (c) 2015 Daniel Campos

Licensed under the MIT license.

About

AngularJS Service for dependency injection of mousetrap.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published