angular-cn/packages/platform-browser/animations/test
arturovt c49b28013a fix(animations): cleanup DOM elements when the root view is removed (#41059)
Currently, when importing `BrowserAnimationsModule`, Angular uses `AnimationRenderer`
as the renderer. When the root view is removed, the `AnimationRenderer` defers the actual
work to the `TransitionAnimationEngine` to do this, and the `TransitionAnimationEngine`
doesn't actually remove the DOM node, but just calls `markElementAsRemoved()`.

The actual DOM node is not removed until `TransitionAnimationEngine` "flushes".

Unfortunately, though, that "flush" will never happen, since the root view is being
destroyed and there will be no more flushes.

This commit adds `flush()` call when the root view is being destroyed.

BREAKING CHANGE:
DOM elements are now correctly removed when the root view is removed.
If you are using SSR and use the app's HTML for rendering, you will need
to ensure that you save the HTML to a variable before destorying the
app.
It is also possible that tests could be accidentally relying on the old behavior by
trying to find an element that was not removed in a previous test. If
this is the case, the failing tests should be updated to ensure they
have proper setup code which initializes elements they rely on.

PR Close #41059
2021-03-22 12:58:11 -07:00
..
BUILD.bazel test(platform-browser): remove IE9 and IE10 checks from tests (#39090) 2020-10-13 15:51:48 -07:00
animation_renderer_spec.ts fix(animations): cleanup DOM elements when the root view is removed (#41059) 2021-03-22 12:58:11 -07:00
browser_animation_builder_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
noop_animations_module_spec.ts feat(animations): add support for disabling animations through BrowserAnimationsModule.withConfig (#40731) 2021-02-24 15:08:27 -08:00