Utilizing ngTouch
to eliminate the delay on mobile devices has been effective, however, I have encountered an issue where clicking on an image does not trigger the expected behavior. In my application, clicking on an image is supposed to activate a directive that enlarges the images without using ng-click
. Below is the code for the directive:
app.directive('imageZoom', ['ngDialog', function(ngDialog) {
return {
restrict: 'A',
scope: {
image: '='
},
link: function(scope, element, attr) {
attr.$observe('ngSrc',function(img) {
element.bind('click', function(e) {
e.stopPropagation();
if (something) {
doSomething();
} else {
ngDialog.open({
some template here
});
}
});
});
}
};
}]);
Previously, this functionality was working smoothly until the integration of ngTouch
, leading me to suspect that there may be an issue with the element.bind('click'
component which could be failing to register the click event. It's worth noting that the directive works perfectly in a browser environment, indicating that the issue lies specifically in the touch functionality.