how can we know if an element is present / visible on screen?
Example, I have a list of cards, and want increment a view counter according to the card / cards visible.
I used to use the Jquery Plugin “onScreen”, but how can I do it with angular 2 / ionic 2?
It looks like that project is no longer dependent on jQuery. Have you tried using it? In general, Angular2’s event model plays much more nicely with others than Angular1’s did. I have found mixing and matching other libraries like this (even jQuery plugins) much less troublesome than it used to be.
Thanks! I’ve got it to work!
A few tips to anyone else who might want to use this plugin as well.
We must instantiate it after the view initialization.
We also must specify the element as the container. As we can have more than one element we must specify the container with our page main class like this: