2

I'm currently using Angular 1.3.13, angular-touch 1.3.15, and Cordova 4.1.2 with the following code.

<div ng-controller="myController">
  <ul>
    <li ng-swipe-right="swipeRight()">Swipe Me</li>
    <li ng-swipe-right="swipeRight()">Swipe Me</li>
    <li ng-swipe-right="swipeRight()">Swipe Me</li>
    <li ng-swipe-right="swipeRight()">Swipe Me</li>
  </ul>
</div>

With the following controller.

angular.module('myApp').controller('myController', function($scope, messages) {

    $scope.swipeRight = function() {
        console.log('swipe-right');
    }

});

In the Windows Phone and Windows 8.1 Emulator the swipe event fires fine until the list gets large enough to trigger an overflow the swipe events stop firing. If you set the overflow property to hidden then the swipe events resume working. Has anyone seen this issue before? Please let me know if more info is needed.

user1368448
  • 53
  • 2
  • 8

1 Answers1

0

I have similar problem with Windows store app. Everything works fine for mouse mode control, but for touch mode swipe events do not work. http://hammerjs.github.io/ - Registration of HammerJS listener magically helps, angular swipe events start working.

<div id="myElement" ng-cloak ng-swipe-left='next()' ng-swipe-right='previous()'>

...

//Register swipe event
    var mc = new Hammer($('#myElement')[0]);
        // listen to events...
        mc.on("swipeleft swiperight", function (ev) {
            if(ev.type == "swipeleft")
            {
                //$scope.previous(); //No need for this
            }
            else if (ev.type == "swiperight") {
                //$scope.next();
            }
        });

//Angular Swipe functions
        $scope.next = function() {
            //Do something
        };

        $scope.previous = function() {
                //Do something
        };

I hope this may help.

Zaduvalo
  • 39
  • 3