I have animation that needs to restart on a click. this is my animation :
/* scss file */
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.fadeIn {
animation-name: fadeIn;
animation-duration: 1s;
}
On click this button (Animation It) the animation only working for once
<div [className]="myclass"> Hi Animation </div>
<button ion-button (click)="animationIt()">Animation It</button>
Because on click button again the button not add class because the class is existing ( fadeIn ) on element <div [className]="myclass"> Hi Animation </div>
myclass: string;
animationIt() {
this.myclass = 'fadeIn';
}
Are there way to restart animation (class) on click