1
votes

I'm using Ionic Framework with Angularjs for my app, but I'm getting stuck on the page transitions.

The app is for iOS and the back button gives the direction as forward. Is it possible to set the direction with javascript / Angularjs?

Here is part of my page config.

.config(function ($stateProvider, $urlRouterProvider) {
    $stateProvider

        .state('app', {
            url: "/app",
            abstract: true,
            templateUrl: "templates/menu.html",
            controller: 'AppCtrl'
        })
        .state('app.dashboard', {
            url: "/dashboard",
            views: {
                'menuContent': {
                    templateUrl: "templates/dashboard/dashboard.html"
                }
            }
        })
        .state('app.DLRlogin', {
            url: "/DLR_login",
            views: {
                'menuContent': {
                    templateUrl: "templates/dlr/dlr_login.html"
                }
            }
        })
        .state('app.search_phone', {
            url: "/search_phone",
            views: {
                'menuContent': {
                    templateUrl: "templates/search_phone/search_phone.html"
                }
            }
        })

When the user goes from Dashboard to a page the transition goed forward, which is good, but the back button also gives a forward transition.

2

2 Answers

1
votes

You can define view transitions in $ionicConfigProvider, but you should update to Beta 14.

1
votes

Syntax - $ionicConfigProvider.views.transition(transition-type);

Which style of view transitioning to use.

  • platform: Dynamically choose the correct transition style depending on the platform the app is running from. If the platform is not ios or android then it will default to ios.
  • ios: iOS style transition. android: Android style transition.
  • none: Do not perform animated transitions.

Example - $ionicConfigProvider.views.transition('platform');

Doc - http://ionicframework.com/docs/api/provider/$ionicConfigProvider/