Stop the swipe gesture from bubbling up


#1

I am trying to implement the sidebar functionality like the ones present in youtube app.
Whenever the user swipes from the left edge of the screen, the sidebar should open but when the swipe is from other place(say middle if the screen) it should change the data in the view but not open the sidemenu

I tried to come up a plunkr to demonstrate what i want to do

Can someone help me to implement this?


#2

Right now, Ionic doesn’t have a built-in method to tell where swiping can occur.

I’ve dabbled with your Plunker. You are definitely on to something there. I’ve made some modifications to that any dragging to the right > 150, notifies the controller. They key is the e.gesture.srcEvent.preventDefault().

See this sample : http://plnkr.co/edit/NYKbhULSz6Qneq70IA7N?p=preview

BTW : You don’t need these anymore. They are not used by Ionic.

  <script src="http://code.ionicframework.com/nightly/js/angular/angular-route.js"></script>
  <script src="http://code.angularjs.org/1.2.9/angular-touch.js"></script>