Hi,
I’m having some issue with the animation on .
I started my app with the ionic side menu template and I want to swipe to go visit my next or previous song in my playlist. So it the playlist detail page, I added the following code:
<ion-content class="has-header" on-swipe-right="swipToPrevious()" on-swipe-left="swipToNext()">
In the controller I’m updating the data based on different gestures and everything works fine. However, I have some trouble with the slide animation added to the <ion-nav-view>
directive. Seems like Ionic is smart to automatically added a reverse class to reverse the animation if I’m swiping to the opposite direction, but not always. This is causing some issue that the page will slide to the opposite direction when swipe the page.
Since the same animation also controls other views, I’m not sure if it’s a good idea to remove it. I’m wondering if there is a way for me to control the way it’s injecting the reverse class? Or what method I could use to add animation when calling my swipToPrevious() and swipToNext() function?
Route:
.state('app', {
url: "/app",
abstract: true,
templateUrl: "templates/menu.html",
controller: 'AppCtrl'
})
.state('app.groups', {
url: "/group",
views: {
'menuContent' :{
templateUrl: "templates/group.html"
}
}
})
.state('app.playlists', {
url: "/playlists",
views: {
'menuContent' :{
templateUrl: "templates/playlists.html",
controller: 'PlaylistsCtrl'
}
}
})
.state('app.single', {
url: "/playlists/:playlistId",
views: {
'menuContent' :{
templateUrl: "templates/playlist.html",
controller: 'PlaylistCtrl'
}
}
});
SideMenu HTML:
<ion-side-menus>
<ion-pane ion-side-menu-content>
<ion-nav-bar class="bar-stable" >
</ion-nav-bar>
<ion-nav-view name="menuContent" animation="slide-left-right"></ion-nav-view>
</ion-pane>
<ion-side-menu side="left">
<header class="bar bar-header bar-stable">
<h1 class="title">MyApp</h1>
</header>
<ion-content class="has-header">
<ion-list>
<ion-item nav-clear menu-close ui-sref="app.playlist">
Playlist
</ion-item>
<ion-item nav-clear menu-close ui-sref="app.groups">
Groups
</ion-item>
<ion-item nav-clear menu-close ng-click="login()">
Log out
</ion-item>
</ion-list>
</ion-content>
</ion-side-menu>
</ion-side-menus>
Thanks in advance!
Kikyou