ngtouch
v1.0.1
Published
An angular module to add directives for touch devices
Downloads
2,459
Readme
A angular module to add directives for touch devices.
- Info
- Installing/Loading
- Usage
- Links
- Tests
- Official Documentation
- Contributing
- Security Vulnerabilities
- License
Info
Version: 1.0.1
Author: Mark Topper [Facebook] [Github] [Twitter]
Website: www.webman.io
Email: [email protected]
Installing/Loading
Install using bower:
bower install ngtouch --save
Load the file to you HTML header:
<script type="text/javascript" src="path/to/bower_components/ngtouch/build/ngTouch.min.js"></script>
Usage
You must include the ngTouch dependency on your angular module:
var app = angular.module("demoapp", ["ngTouch"]);
Then in your HTML you can use:
<div ng-touchmove="someFunction($event)" ng-touchstart="someFunction($event)" ng-touchend="someFunction($event)"></div>
ng-touchstart
Once a touch device start touching, this event will be called.
Here is a usage example:
yourController.js
$scope.onTouchstart = function($event) {
console.log('touchstart event called');
}
yourView.html
<div ng-touchstart="onTouchstart($event)"></div>
ng-touchend
Once a touch device end touching, this event will be called.
Here is a usage example:
yourController.js
$scope.onTouchend = function($event) {
console.log('touchend event called');
}
yourView.html
<div ng-touchend="onTouchend($event)"></div>
ng-touchmove
Whenever a touch device is touched and moving.
Here is a usage example:
yourController.js
$scope.onTouchmove = function($event) {
console.log('touchmove event called');
}
yourView.html
<div ng-touchmove="onTouchmove($event)"></div>
Links
The following is a list of libraries that extend ngTouch:
- None yet
Contact me at [email protected] to get yours added.
The following is a list of libraries that requires by ngTouch:
- Angular: HTML enhanced for web apps
The following is a list of alternatives for ngTouch:
ngTouchmove: A angular module to add directive
ng-touchmove
.ngTouchstart: A angular module to add directive
ng-touchstart
.ngTouchend: A angular module to add directive
ng-touchend
.
Tests
From the project directory, tests can be ran using gulp test
Official Documentation
Documentation for this library can be found on the website.
Contributing
Thank you for considering contributing! The contribution guide can be found in the contributions.md.
Security Vulnerabilities
If you discover a security vulnerability within ngTouch, please send an e-mail to Mark Topper at [email protected]. All security vulnerabilities will be promptly addressed.
License
Released under the MIT License - see license.txt
for details.