Hi Everyone,
So I am using lottie animations in my ionic 3 app and i would like to slow down the speed of the animation and set the direction.
Do you have any idea of how I could do it ?
Thanks for the answers.
Use ng-lottie
check the documentation from ng-lottie
You can set animation speed with the following method :
setSpeed(speed: number) {
this.animationSpeed = speed;
this.anim.setSpeed(speed);
}
Hi @iamdevsaikat thanks for your answer.
I saw the documentation. So after putting the method in my ts file , how should I use it in my html view ?
@adjacoumbasamb in html use lottie-animation-view
Example :
HTML :
<lottie-animation-view [options]="lottieConfig"></lottie-animation-view>
Component:
this.lottieConfig = {
path: 'assetsnimationons/animation.json',
};
@iamdevsaikat Yes i’ve done like that in my component :
and in my html view :
I think i’m missing something but I don’t know what it is.
@adjacoumbasamb import LottieAnimationViewModule
in module.ts
Use LottieAnimationViewModule
instead of LottieAnimationViewModule.forRoot()
in module.ts
Okay done and for the speed function ? Am I using it in the right way ?