feat(animations): expose the triggerName
within the transition event
Closes #13600
This commit is contained in:
@ -12,8 +12,8 @@ import {AnimationTransitionEvent} from './animation_transition_event';
|
||||
|
||||
export class AnimationTransition {
|
||||
constructor(
|
||||
private _player: AnimationPlayer, private _element: ElementRef, private _fromState: string,
|
||||
private _toState: string, private _totalTime: number) {}
|
||||
private _player: AnimationPlayer, private _element: ElementRef, private _triggerName: string,
|
||||
private _fromState: string, private _toState: string, private _totalTime: number) {}
|
||||
|
||||
private _createEvent(phaseName: string): AnimationTransitionEvent {
|
||||
return new AnimationTransitionEvent({
|
||||
@ -21,7 +21,8 @@ export class AnimationTransition {
|
||||
toState: this._toState,
|
||||
totalTime: this._totalTime,
|
||||
phaseName: phaseName,
|
||||
element: this._element
|
||||
element: this._element,
|
||||
triggerName: this._triggerName
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -44,18 +44,21 @@ export class AnimationTransitionEvent {
|
||||
public totalTime: number;
|
||||
public phaseName: string;
|
||||
public element: ElementRef;
|
||||
public triggerName: string;
|
||||
|
||||
constructor({fromState, toState, totalTime, phaseName, element}: {
|
||||
constructor({fromState, toState, totalTime, phaseName, element, triggerName}: {
|
||||
fromState: string,
|
||||
toState: string,
|
||||
totalTime: number,
|
||||
phaseName: string,
|
||||
element: any
|
||||
element: any,
|
||||
triggerName: string
|
||||
}) {
|
||||
this.fromState = fromState;
|
||||
this.toState = toState;
|
||||
this.totalTime = totalTime;
|
||||
this.phaseName = phaseName;
|
||||
this.element = new ElementRef(element);
|
||||
this.triggerName = triggerName;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user