AngularJS ngTouch $swipe move doesn't work -
i used ngtouch module implement things touch devices. 'start' works fine. console.log() in 'move' case has not been displayed, if drag object out of first drop-zone. inside first drop-zone 'move' works.
html:
<div class="drop-zone" ng-trop="true"> <my-directive ng-drag="true" ng-drag-data="myobject" on-drag="mymethod()"></my-directive> </div> <div class="drop-zone" ng-trop="true"></div>
directive:
angular.module('myapp') .directive('mydirective', ['$swipe', function($swipe) { return { restrict: 'ea', scope: { ondrag: '&' }, link: function(scope, ele, attrs, ctrl) { $swipe.bind(ele, { 'start': function(coords) { scope.ondrag(); }, 'move': function(coords) { console.log("is moving"); } } } }]);
maybe interested in use case: want window scrolls automatically, if user drags object on bottom of page. drag , drop solved ngdraggable ( https://github.com/fatlinesofcode/ngdraggable ) maybe there alternatives. ideas?
Comments
Post a Comment