diff --git a/src/ngAnimate/animate.js b/src/ngAnimate/animate.js index 6b72f4a87628..64be7ba7f65a 100644 --- a/src/ngAnimate/animate.js +++ b/src/ngAnimate/animate.js @@ -697,7 +697,7 @@ angular.module('ngAnimate', ['ng']) } function animationsDisabled(element, parent) { - if(element == $rootElement) { + if(element[0] == $rootElement[0]) { return rootAnimateState.disabled || rootAnimateState.running; } diff --git a/test/ngAnimate/animateSpec.js b/test/ngAnimate/animateSpec.js index bc0d334785e2..aba684b538b7 100644 --- a/test/ngAnimate/animateSpec.js +++ b/test/ngAnimate/animateSpec.js @@ -96,6 +96,11 @@ describe("ngAnimate", function() { $animate.addClass(elm2, 'klass2'); expect(count).toBe(2); + + var root = angular.element($rootElement[0]); + $rootElement.addClass('animated'); + $animate.addClass(root, 'klass2'); + expect(count).toBe(3); }); });