wzr1337 / angular-gestures

AngularJS directive that adds support for multi touch gestures to your app. Based on hammer.js.
MIT License
509 stars 100 forks source link

how to use 'drag' events? #49

Closed yy7054wyq5 closed 8 years ago

yy7054wyq5 commented 8 years ago

like this:

  link: function($scope, iElm, iAttrs, controller) {
        var element = document.getElementById('pro');
        var drag = Hammer(element).on("drag", function(event) {
            alert('hello!');
        });
    }

it doesn't work;

but:

  link: function($scope, iElm, iAttrs, controller) {
        var element = document.getElementById('pro');
        var tap = Hammer(element).on("tap", function(event) {
            alert('hello!');
        });
    }

it's ok

this is my recognizers

 hammerDefaultOptsProvider.set({
    recognizers: [
        [Hammer.Tap, {time: 250}],//ok
        [Hammer.Swipe],//ok
        [Hammer.Drag]// i don't know how to use 'drag' in recognizers     

    ]
 });

thanks your answer,best wishes~