mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
51be9bbe29
Currently, when importing `BrowserAnimationsModule`, Angular provides `AnimationRendererFactory` as the `RendererFactory2`. The `AnimationRendererFactory` relies on the `AnimationEngine`. The `AnimationEngine` may be created earlier than the `ApplicationRef` (e.g. if it's requested within the `APP_INITIALIZER` before the `ApplicationRef` is created). This means that Angular will add the `AnimationEngine` to `R3Injector.onDestroy` before the `ApplicationRef`. The `R3Injector` will call `ngOnDestroy()` on the `AnimationEngine` before the `ApplicationRef`, which means the `flush()` will be called earlier before views are destroyed. PR Close #45108 PR Close #45143