Support slowing animations (for debugging)

This commit is contained in:
Max Lynch
2014-05-01 13:34:42 -05:00
committed by Andy Joslin
parent 4bea189a11
commit 2872cf603e
3 changed files with 23 additions and 11 deletions

View File

@@ -1,3 +1,4 @@
/**
* @ngdoc service
* @name $ionicAnimation
@@ -45,14 +46,16 @@
*
*/
IonicModule
.factory('$ionicAnimation', [
'$rootScope',
'$document',
'$compile',
'$timeout',
'$interval',
function($rootScope, $document, $compile, $timeout, $interval) {
return function(opts) {
return ionic.Animation.create(opts);
}
}]);
.provider('$ionicAnimation', function() {
var useSlowAnimations = false;
this.setSlowAnimations = function(isSlow) {
useSlowAnimations = isSlow;
};
this.$get = [function() {
return function(opts) {
opts.useSlowAnimations = useSlowAnimations;
return ionic.Animation.create(opts);
}
}]
});