[Animations] params not evaluated when transitioning to void state (e.g. ngIf :leave) #20796
Labels
area: animations
freq2: medium
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
type: bug/fix
Milestone
I'm submitting a...
Current behavior
I want to animate an element which is being added and removed with *ngIf. I need to pass a parameter to the animation at run-time, which I am doing like this:
Currently, the
triggerParams
getter is being evaluated during the transition fromvoid => *
, but not the other way around, with the result that the div fades in, but does not fade out.Expected behavior
I would expect the
triggerParams
getter to be evaluated also when the div transitions from* => void
so that the param is set to{ opacity: 0 }
and it fades out.Minimal reproduction of the problem with instructions
https://stackblitz.com/edit/repro-for-20796?file=app/app.component.ts
What is the motivation / use case for changing the behavior?
So that I can animate *ngIf with dynamic params.
Environment
The text was updated successfully, but these errors were encountered: