I'm working on animation for showing and hiding a component.
My Plunker: https://embed.plnkr.co/BxT8SKBq8JwuPP16FDu4/
<animation [@toggleHeight]="isShow"></animation>
<button (click)="isShow = (isShow==='show')? 'hide' : 'show'">Toggle</button>
<calc></calc>
When click the botton, I want the "animation" div disappear, but it doesn't. The content inside "animation" component still showing.
Am I doing something wrong? Any help would be great. Thank you in advance.
The problem is that you are trying to animate a custom element. It has no
displaymode defined in CSS. If you addanimation { display: block; }to your CSS it will work fine. You can do it inside its parent component like thisOr you can add it to some global CSS file.