I have made swipes currently like this, which does not work. I am using the tabs template.
<ion-content class="padding" on-swipe-left="goBack()" on-swipe-right="goForward()">
.controller('SwipeCtrl', function ($scope, $ionicTabsDelegate) {
$scope.goForward = function () {
var selected = $ionicTabsDelegate.selectedIndex();
if (selected != -1) {
$ionicTabsDelegate.select(selected + 1);
}
}
$scope.goBack = function () {
var selected = $ionicTabsDelegate.selectedIndex();
if (selected != -1 && selected != 0) {
$ionicTabsDelegate.select(selected - 1);
}
}
})
My other question is, how can I make 2 cards in same tab with horizontal scroll, like this http://i.imgur.com/YKaozOk.png When you swipe the card from right visible, the left card moves partly hidden to the left. I tried this by modifying this example https://github.com/Gajotres/IonicCarouselDemo but it did not work at all.