Angular Touch ngTouch
causes the click to occur on touch release.
Is there a way to make the click happen on touch start?
The fast-click
directive below seems to do what I want on touchscreens, but it doesn't work with mouse clicks.
myApp.directive('fastClick', ['$parse', function ($parse) {
return function (scope, element, attr) {
var fn = $parse(attr['fastClick']);
var initX, initY, endX, endY;
var elem = element;
elem.bind('touchstart', function (event) {
event.preventDefault();
initX = endX = event.touches[0].clientX;
initY = endY = event.touches[0].clientY;
scope.$apply(function () { fn(scope, { $event: event }); });
});
};
}
]);