Cancel all animations in app?


#1

Is there any way to cancel all animations in app?


#2

This will turn off all transition animations between views:

angular.module('ionicApp', ['ionic'])

.config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider ) {
    $ionicConfigProvider.views.transition('none');
})

#3

Thank you very mutch for replay :slight_smile:


#4

I get an error saying:
"Uncaught Error: [$injector:modulerr] Failed to instantiate module starter due to:
TypeError: Cannot read property ‘transition’ of undefined "

hm, when i checked documentations, i could not see anyting wrong on my part. Should i include any angularjs modules or something?


#5

Hmm I’m not sure. Do you have an <ion-nav-view> tag declared ? It looks like that is what it is trying to attach the transition to:

<ion-nav-view class="view-container" nav-view-transition="none" nav-view-direction="none">
</ion-nav-view>

#6

Cool, i will try this solution :smile:
Thank you :smile:


#7

Hi brandyshea
i keep getting this error too when i try to disable animations. i am currently not using the “ion-nav-view” tag, i am only using “ion-view” for my templates, could this be the problem?
Thanks


#8

Yes, it is setting nav-view-transition to none when you use this configuration. You should have (at least) one ion-nav-view that holds your views. If you aren’t using an ion-nav-view it has nothing to attach it to. What is the structure of your app like?


#9

in our app we have multiple states that have their own template

			.state('app.example, {
				url: "/example",
				views: {
					example': {
						templateUrl: "templates/example.html",
						controller: "ExampleCtrl"
					}
				}
			})

the template for the state looks like

<ion-view> what we want to display </ion-view>

—EDIT—
We have one ion-nav-view tag in out index but still getting this error:
TypeError: Cannot read property ‘transition’ of undefined


#10

Could you throw together a quick codepen with your app structure?


#11

thanks for your help brandyshea, I managed to fix this problem by updating the version of ionic we were using.
cheers