In angular, I want to trigger a function and/or set a css-class once an element is actually visible on the screen, as in once you scroll down for example. What’s the best practice for this?
I was trying to do the same thing and after lot of research I found a directive that does exactly what I needed:
It was also very easy to setup. In case you run into issues with this then let me know and I can help you out.
You may want to simply build a directive over a library like ifvisible.js.