how to initialize a svg animation in angular at the moment is displayed on the screen?


I have animations in svg that i need initialize after display in the viewport, if i use de svg in javascript vanilla this work properly, but if i use angular the animation start in the moment of loading de page and not in the moment of showing in the screen.

I solved it by creating a structural directive that checks if the parent of the image is on the screen, but I would like to have a cleaner solution without adding the directive, since I have to pass information about the image to it to reserve space on the screen as the image is added to the dom after its father appears on the screen.

Source: Angular Questions

Categorized as angular, animation, svg Tagged , ,


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us