/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/animations/src/animation_event.ts
72 строки
2 KB
Jessica Janiuk
refactor(animations): deprecate the animations package (#62795)
29 июл 2025, 12:50
29 июл 2025, 12:50
9766116
Код
Авторство
О чём код?
/** * @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.dev/license */ /** * An instance of this class is returned as an event parameter when an animation * callback is captured for an animation either during the start or done phase. * * ```ts * @Component({ * host: { * '[@myAnimationTrigger]': 'someExpression', * '(@myAnimationTrigger.start)': 'captureStartEvent($event)', * '(@myAnimationTrigger.done)': 'captureDoneEvent($event)', * }, * animations: [ * trigger("myAnimationTrigger", [ * // ... * ]) * ] * }) * class MyComponent { * someExpression: any = false; * captureStartEvent(event: AnimationEvent) { * // the toState, fromState and totalTime data is accessible from the event variable * } * * captureDoneEvent(event: AnimationEvent) { * // the toState, fromState and totalTime data is accessible from the event variable * } * } * ``` * * @publicApi * * @deprecated 20.2 Use `animate.enter` or `animate.leave` instead. Intent to remove in v23 */ export interface AnimationEvent { /** * The name of the state from which the animation is triggered. */ fromState: string; /** * The name of the state in which the animation completes. */ toState: string; /** * The time it takes the animation to complete, in milliseconds. */ totalTime: number; /** * The animation phase in which the callback was invoked, one of * "start" or "done". */ phaseName: string; /** * The element to which the animation is attached. */ element: any; /** * Internal. */ triggerName: string; /** * Internal. */ disabled: boolean; }