Just in case someone finds this, who does not use a coffee script, here is the conversion
app.directive("ngTap", function() { return function($scope, $element, $attributes) { var tapped; tapped = false; $element.bind("click", function() { if (!tapped) { return $scope.$apply($attributes["ngTap"]); } }); $element.bind("touchstart", function(event) { return tapped = true; }); $element.bind("touchmove", function(event) { tapped = false; return event.stopImmediatePropagation(); }); return $element.bind("touchend", function() { if (tapped) { return $scope.$apply($attributes["ngTap"]); } }); }; });
this is gfTop because the sample is a good movies app. Feel free to change this as you wish.
Also note that you must change all your "ng-click" to "gfTap".
UPDATED: to handle click and click events.
source share