angular.module('myApp') .directive('swipe-handler-directive', function() { return { restrict: "A", scope: {}, link: function($scope, $element, $attrs) { // do all the mousedown/mousemove event handler stuff // here, and call the parent scope's click handler // from here, but only if a swipe hasn't occurred } } }) ;