aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorMatias Niemelä2013-06-17 22:40:01 -0400
committerIgor Minar2013-07-15 09:30:54 -0700
commit031da1f96b3e0074e682e35ac909256c37c91864 (patch)
tree105a289325af599d5b9f8d12a6a2b4e5ba672056 /docs
parent14626d0bc57cf55e8bde4a329b896308b6c09880 (diff)
downloadangular.js-031da1f96b3e0074e682e35ac909256c37c91864.tar.bz2
fix($animator): ensure animations are always disabled for an element that is not attached to the DOM
Diffstat (limited to 'docs')
-rw-r--r--docs/component-spec/annotationsSpec.js12
1 files changed, 10 insertions, 2 deletions
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('<div class="parent"></div>');
element = angular.element('<div data-url="' + url + '" foldout></div>');
- 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();
});