i have ng-click on the ng-drag element, when i am starting to move the element it's everything ok, but when i stop it, that element activate my ng-click, how can i avoid that ng-click?
<div ng-click="unselectImage(image);" ng-drag="true" ng-drag-data="'multipleItems'" ng-center-anchor="true" data-allow-transform="false" ng-drag-success="selectImage(image);"></div>
I am using ngDraggable. I tried to use ng-drag-success
without success.
What i did, with help of David Zemens. i figure it out that i can use
$rootScope.$on('draggable:start', function (data) {
isDragging=true;
});
and inside my ng-click function i add something like this:
$scope.unselectImage = function (image) {
if(isDragging) isDragging=false;
else{
// do the magic
}
}
and generally it do the trick. When drag start, it broadcast that it is starting, and when it end's ng-click work out, in our case it simply say that drag is over.