-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to switch animation after initialization? #23
Comments
Hi @laulaaa if you notice Im the one who asked in that ios thread how to do it for angular hah. So far the solution I have implemented is not ideal for loading times but it performs okay after initialization.
This performs fine after the views are initialized as the CSS changes in the "off" class do not trigger screen re-draws, and only one animtion is playing at one time. Hope this maybe helps as a temporary fix! |
And maybe it helps or doesnt but in the JS, I keep a variable to hold an ID for whichever animation is currently on, which helps with making the necessary changes |
Hi, please help.. I need the solution too. |
According to the documentation here: Available methods are:
So i'm guessing you would use them with ng-lottie by using the html: And then the function:
and then later:
But doesn't seem to work for me...as destroy seems to destroy lottie instance but not reset the angular element. Inspecting the lottie instance there are these methods available:
When resetting an animation it looks as though you have to do destroy then loadAnimation:
Example: which ng-loggie doesn't seem to have support for. I managed to kind of get it working by modifying ng-lottie:
Usage: and: |
Any update on this? I ran into the same issue. |
Hello.
I'm trying to figure out how to switch animation after initialization, but I don't see it in the documentation. Is it possible?
I found the same question in airbnb/ios. Here is the reference: LINK
Right now, I'm reloading the component of the animation using *ngif hiding and showing it again, it works, but not always.
I'm looking for a better solution.
The text was updated successfully, but these errors were encountered: