I have an AngularJS directive that binds to the scroll event:
angular.element($window).bind('scroll',function()
{
});
It's used to update the class of a fixed element when it reaches the bottom of the page.
The problem I have is that when a function fires new elements are drawn and the page grows longer. When scrolling again this is detected properly and the element updates it's class correctly, but until the scroll event fires it looks wrong.
Is there a way to bind the directive to also fire when new elements are drawn to the DOM as well as to scroll?