Long time user, first time poster - Ionic is the best!
Just had a quick question for a best practice on how to include swipe to navigate from a global sense. I’ve done quite a bit of scouring, but haven’t come up with an elegant solution as of yet.
I would like a solution that doesn’t require a function in each view controller to activate a goback or goforward in history, just one global that gets the job done.
Is there a magical way to include on-swipe-right and on-swipe-left from the top ion-nav-view of my app (¿would this even be the right spot?), and have (again a best practice) history function that will remember the state and allow for clean swiping?
Not sure if that answers your question specifically:
I create an abstract controller, that sits on top of all the other controllers (nested). I let this controller handle the menu and other functions, that I need in every controller.
I actually managed to do it in ionic by placing an absolutely positioned div with a high z-index and a width of something like 20px on the left of the screen in my <body> tag. I just had to add the on-swipe-right="backSwipe()" directive and plug it to a function in my main controller :