mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
024e9bf54d
This commit ensures we flush animations by calling renderFactory begin/end in cases where the ApplicationRef._tick happens in a mode that skips straight to the render hooks. PR Close #55564
23 lines
989 B
TypeScript
23 lines
989 B
TypeScript
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
|
|
import {NoopAnimationStyleNormalizer} from './dsl/style_normalization/animation_style_normalizer';
|
|
import {WebAnimationsStyleNormalizer} from './dsl/style_normalization/web_animations_style_normalizer';
|
|
import {NoopAnimationDriver} from './render/animation_driver';
|
|
import {AnimationEngine} from './render/animation_engine_next';
|
|
import {WebAnimationsDriver} from './render/web_animations/web_animations_driver';
|
|
|
|
export function createEngine(type: 'animations' | 'noop', doc: Document): AnimationEngine {
|
|
// TODO: find a way to make this tree shakable.
|
|
if (type === 'noop') {
|
|
return new AnimationEngine(doc, new NoopAnimationDriver(), new NoopAnimationStyleNormalizer());
|
|
}
|
|
|
|
return new AnimationEngine(doc, new WebAnimationsDriver(), new WebAnimationsStyleNormalizer());
|
|
}
|