简体   繁体   中英

Angular List item animation with custom component

I am new with angular and angular animation and I want to understand something.

I've created an animation on a list of item (on enter / on leave). For each item, I use a custom component. And to make the animation working, I have to wrap the component inside a div.

https://stackblitz.com/edit/angular-animation-question-with-component?file=src%2Fapp%2Fhello.component.html

Is it a limitation ? Or can I do something to make the animation working with the "main" div of the custom component ?

You just need to set display: block to your box component host element, you can do that in css like:

:host {
  display: block
}

Here is changed example on stackblitz .

Hope that helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM