diff --git a/packages/animations/browser/src/render/transition_animation_engine.ts b/packages/animations/browser/src/render/transition_animation_engine.ts index bfa77f5882..ad3cb6705c 100644 --- a/packages/animations/browser/src/render/transition_animation_engine.ts +++ b/packages/animations/browser/src/render/transition_animation_engine.ts @@ -817,6 +817,7 @@ export class TransitionAnimationEngine { const disabledElementsSet = new Set(); this.disabledNodes.forEach(node => { + disabledElementsSet.add(node); const nodesThatAreDisabled = this.driver.query(node, QUEUED_SELECTOR, true); for (let i = 0; i < nodesThatAreDisabled.length; i++) { disabledElementsSet.add(nodesThatAreDisabled[i]); diff --git a/packages/animations/src/animation_metadata.ts b/packages/animations/src/animation_metadata.ts index 4b8af5d0e8..cc31cc3f7d 100755 --- a/packages/animations/src/animation_metadata.ts +++ b/packages/animations/src/animation_metadata.ts @@ -282,11 +282,12 @@ export interface AnimationStaggerMetadata extends AnimationMetadata { *
...
* ``` * - * ## Disable Child Animations + * ## Disable Animations * A special animation control binding called `@.disabled` can be placed on an element which will - then disable animations for any inner animation triggers situated within the element. + then disable animations for any inner animation triggers situated within the element as well as + any animations on the element itself. * - * When true, the `@.disabled` binding will prevent inner animations from rendering. The example + * When true, the `@.disabled` binding will prevent all animations from rendering. The example below shows how to use this feature: * * ```ts @@ -312,8 +313,8 @@ export interface AnimationStaggerMetadata extends AnimationMetadata { * The `@childAnimation` trigger will not animate because `@.disabled` prevents it from happening (when true). * - * Note that `@.disbled` will only disable inner animations (any animations running on the same - element will not be disabled). + * Note that `@.disbled` will only disable all animations (this means any animations running on + * the same element will also be disabled). * * ### Disabling Animations Application-wide * When an area of the template is set to have animations disabled, **all** inner components will diff --git a/packages/core/test/animation/animation_integration_spec.ts b/packages/core/test/animation/animation_integration_spec.ts index 72133a8515..5c751992c8 100644 --- a/packages/core/test/animation/animation_integration_spec.ts +++ b/packages/core/test/animation/animation_integration_spec.ts @@ -2349,7 +2349,7 @@ export function main() { expect(players[0].totalTime).toEqual(1234); }); - it('should not disable animations for the element that they are disabled on', () => { + it('should disable animations for the element that they are disabled on', () => { @Component({ selector: 'if-cmp', template: ` @@ -2384,8 +2384,7 @@ export function main() { fixture.detectChanges(); let players = getLog(); - expect(players.length).toEqual(1); - expect(players[0].totalTime).toEqual(1234); + expect(players.length).toEqual(0); resetLog(); cmp.disableExp = false;