wzr1337 / angular-gestures

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

0.3.0 does not work with any other events than tap #36

Closed johannesjo closed 9 years ago

johannesjo commented 9 years ago

they're just not firing.

IVLMediaInc commented 9 years ago

I'm noticing the issue as well....none of the events seem to be firing at all.

Installed via bower, added angular-gestures as dependency, linked gestures.min.js and the hammerjs files, also have jquery included.

Tested simple function nextSlide() using ng-click and worked fine, but when put inside hm-swipe-right="nextSlide()" it never fired the function.

johannesjo commented 9 years ago

Seems like you have to initialize the listeners first:

 yourApp.config(function (hammerDefaultOptsProvider)
    {
        hammerDefaultOptsProvider.set({
            recognizers: [
                [Hammer.Tap],
                [Hammer.Press],
                [Hammer.Pan]
            ]
        });
    });

It is not really documented unfortunately.

IVLMediaInc commented 9 years ago

Thanks...I'm going to add to our config and see if that resolves this.

plumpNation commented 9 years ago

Thanks @johannesjo for the fix and of course @wzr1337 for the module :+1:

wzr1337 commented 9 years ago

Thanks @johannesjo for helping out.