Animation for newly rendered elements, but not on page load

前端 未结 4 1656
小鲜肉
小鲜肉 2021-01-05 12:35

I\'m subscribed to a Firebase real-time database so that when I submit something to it, it immediately renders in the view without any need for jQuery or ajax.

I\'d

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-05 13:12

    Since Angular 4.25 there's an easier way to do this: If you want to suppress an :enter animation on view initialization, just wrap it with the following animation:

    template: `
      
    ...
    `, animations: [ trigger('preventInitialChildAnimations', [ transition(':enter', [ query(':enter', [], {optional: true}) ]) ]), ... ]

提交回复
热议问题