feat(animations): expose element
and params
within transition matchers (#22693)
PR Close #22693
This commit is contained in:

committed by
Kara Erickson

parent
db56836425
commit
58b94e6f5e
@ -24,8 +24,8 @@ export class AnimationTransitionFactory {
|
||||
private _triggerName: string, public ast: TransitionAst,
|
||||
private _stateStyles: {[stateName: string]: AnimationStateStyles}) {}
|
||||
|
||||
match(currentState: any, nextState: any): boolean {
|
||||
return oneOrMoreTransitionsMatch(this.ast.matchers, currentState, nextState);
|
||||
match(currentState: any, nextState: any, element: any, params: {[key: string]: any}): boolean {
|
||||
return oneOrMoreTransitionsMatch(this.ast.matchers, currentState, nextState, element, params);
|
||||
}
|
||||
|
||||
buildStyles(stateName: string, params: {[key: string]: any}, errors: any[]) {
|
||||
@ -89,8 +89,9 @@ export class AnimationTransitionFactory {
|
||||
}
|
||||
|
||||
function oneOrMoreTransitionsMatch(
|
||||
matchFns: TransitionMatcherFn[], currentState: any, nextState: any): boolean {
|
||||
return matchFns.some(fn => fn(currentState, nextState));
|
||||
matchFns: TransitionMatcherFn[], currentState: any, nextState: any, element: any,
|
||||
params: {[key: string]: any}): boolean {
|
||||
return matchFns.some(fn => fn(currentState, nextState, element, params));
|
||||
}
|
||||
|
||||
export class AnimationStateStyles {
|
||||
|
Reference in New Issue
Block a user