diff options
| author | Matias Niemelä | 2013-06-17 22:40:01 -0400 |
|---|---|---|
| committer | Igor Minar | 2013-07-15 09:30:54 -0700 |
| commit | 031da1f96b3e0074e682e35ac909256c37c91864 (patch) | |
| tree | 105a289325af599d5b9f8d12a6a2b4e5ba672056 /docs/component-spec/annotationsSpec.js | |
| parent | 14626d0bc57cf55e8bde4a329b896308b6c09880 (diff) | |
| download | angular.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/component-spec/annotationsSpec.js')
| -rw-r--r-- | docs/component-spec/annotationsSpec.js | 12 |
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(); }); |
