0

How to add ng-swipe-left and ng-swipe-right using angular-touch library to navigate angularUI datepicker next & previous months ?

I added the plunker here

    $scope.Next = function() {
    $scope.$evalAsync(function() {
      angular.element(document.querySelector('.pull-right')).triggerHandler('click');
    });
  };

  $scope.Previous = function() {
    $scope.$evalAsync(function() {
      angular.element(document.querySelector('.pull-right')).triggerHandler('click');
    });
  };

From the plunker code , I am getting Error: $rootScope:inprog Action Already In Progress from browser console.

User_MVC
  • 251
  • 2
  • 7
  • 21

1 Answers1

0

Used $timeout service.working good.

        $scope.Next = function () {
            $timeout(function () {
                angular.element(document.querySelectorAll('.pull-right')[0]).triggerHandler('click');
            });
        };

        $scope.Previous = function () {
            $timeout(function () {
                angular.element(document.querySelectorAll('.pull-left')[0]).triggerHandler('click');
            });
        };
User_MVC
  • 251
  • 2
  • 7
  • 21