Persist last style in AnimationBuilder

19 views Asked by At

I am using AnimationBuilder inside a directive and I need to persist some styles after animation. My current code is:

const animationPlayer: AnimationPlayer = this.animationBuilder.build([
    style({ scale: 1 }),
    animate('250ms ease-out', style({ scale: 1.25 }))
]).create(this.elementRef.nativeElement);

animationPlayer.play();

The problem is, the final style scale: 1.25 is not persisted. I thought of adding the states but I can't find how to switch states in AnimationBuilder

0

There are 0 answers