angular-hammer
angular-hammer is a Hammer.js adapter for AngularJS. It allows one to use directives which handle Hammer.js recognizers.
angular-hammer defines a single directive for each gesture recognizer. The directives are build in the following way: hm-{HAMMER_RECOGNIZER}
, for instance hm-tap
.
Installation
Using Bower:
$ bower install angular-hammer2 --save
Or manually, downloading a suitable file from dist
directory.
Usage
To add a simple tap gesture recognizer use hmTap
directive:
If you want to specify more options use with
keyword:
or hmTapOpts
directive:
Optimized directives
In some situation you may want to add a gesture recognizer which does not trigger $digest
cycle automatically. In order to do this, add -o
prefix to the directive, e.g. hm-pan-o="method($hmEvent)
.
The following directives are available in an optimized form: pan
, pinch
, rotate
.
Changelog
v1.0.1
- Changed lib name to
angular-hammer-recognizers
.
v1.0.0
- Directives based on HammerJS recognizers.
License
MIT