Answer the question
In order to leave comments, you need to log in
How in angular to animate a child element before the parent element starts the :leave animation?
In the element list example , when an element is removed, the element performs a :leave animation.
There is a div inside the element that needs to be animated so that when the element is removed from the list, the div's animation is played.
How to solve this problem?
Answer the question
In order to leave comments, you need to log in
Probably worth using animateChild:
animations: [
trigger('parentAnimation', [
transition(':leave', [
query('@itemAnim', [
animateChild()
])
])
]),
trigger('itemAnim', [
transition(':enter', [
animate(500)
]),
transition(':leave', [
group([
animate('0.5s ease', style({ transform: 'translateY(-20%)', 'height':'0px' })),
animate('0.5s 0.2s ease', style({ opacity: 0 }))
])
])
])
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question