From 031da1f96b3e0074e682e35ac909256c37c91864 Mon Sep 17 00:00:00 2001 From: Matias Niemelä Date: Mon, 17 Jun 2013 22:40:01 -0400 Subject: fix($animator): ensure animations are always disabled for an element that is not attached to the DOM --- docs/component-spec/annotationsSpec.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'docs/component-spec') diff --git a/docs/component-spec/annotationsSpec.js b/docs/component-spec/annotationsSpec.js index b4c8cd9d..29cb9c53 100644 --- a/docs/component-spec/annotationsSpec.js +++ b/docs/component-spec/annotationsSpec.js @@ -91,13 +91,21 @@ describe('Docs Annotations', function() { } }); }); - inject(function($rootScope, $compile, $templateCache) { + inject(function($rootScope, $compile, $templateCache, $rootElement, $animator) { + $animator.enabled(true); url = '/page.html'; $scope = $rootScope.$new(); parent = angular.element('
'); element = angular.element(''); - body.append(parent); + + //we're injecting the element to the $rootElement since the changes in + //$animator only detect and perform animations if the root element has + //animations enabled. If the element is not apart of the DOM + //then animations are skipped. parent.append(element); + $rootElement.append(parent); + body.append($rootElement); + $compile(parent)($scope); $scope.$apply(); }); -- cgit v1.2.3