diff --git a/src/ngAnimate/animateQueue.js b/src/ngAnimate/animateQueue.js index 374377de8b6e..28c4785ca449 100644 --- a/src/ngAnimate/animateQueue.js +++ b/src/ngAnimate/animateQueue.js @@ -66,10 +66,10 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) { return (nO.addClass && nO.addClass === cO.removeClass) || (nO.removeClass && nO.removeClass === cO.addClass); }); - this.$get = ['$$rAF', '$rootScope', '$rootElement', '$document', '$$HashMap', - '$$animation', '$$AnimateRunner', '$templateRequest', '$$jqLite', - function($$rAF, $rootScope, $rootElement, $document, $$HashMap, - $$animation, $$AnimateRunner, $templateRequest, $$jqLite) { + this.$get = ['$$rAF', '$rootScope', '$rootElement', '$$HashMap', '$$animation', + '$$AnimateRunner', '$templateRequest', '$$jqLite', + function($$rAF, $rootScope, $rootElement, $$HashMap, $$animation, + $$AnimateRunner, $templateRequest, $$jqLite) { var activeAnimationsLookup = new $$HashMap(); var disabledElementsLookup = new $$HashMap(); @@ -105,7 +105,7 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) { } ); - var bodyElement = jqLite($document[0].body); + var bodyElement = jqLite(document.body); var callbackRegistry = {}; diff --git a/test/ng/windowSpec.js b/test/ng/windowSpec.js index 97edd02e859f..6b9fa2d14b05 100644 --- a/test/ng/windowSpec.js +++ b/test/ng/windowSpec.js @@ -9,4 +9,9 @@ describe('$window', function() { module({$window: {}}); inject(['$sce', angular.noop]); }); + + it('should be able to mock $window with $animate', function() { + module('ngAnimate', {$window: {}}); + inject(['$animate', angular.noop]); + }); });