angular 2 ngIf and CSS transition/animation

前端 未结 7 1749
予麋鹿
予麋鹿 2020-11-29 16:23

I want a div to slide in from the right in angular 2 using css.

  

7条回答
  •  庸人自扰
    2020-11-29 16:56

    In my case I declared the animation on the wrong component by mistake.

    app.component.html

      
      
    

    The animation needs to be declared on the component where the element is used in (appComponent.ts). I was declaring the animation on OrderDetailsComponent.ts instead.

    Hopefully it will help someone making the same mistake

提交回复
热议问题