I'm currently in the process of transitioning my jQuery application to AngularJS.
One of the tasks I need to accomplish involves updating the Data Array whenever a scroll event occurs. How can I achieve this?
Here is the existing jQuery code at Plunker: http://plnkr.co/edit/jdwxH5pmyecuWTsrutrO?p=preview
When you scroll within the div, a list displaying the index of visible elements is shown.
What I aim to do is create a directive or filter (ng-check-visibility
) for the ng-repeat element, like so:
<div ng-repeat="item in data" ng-check-visibility>
{{item.name}}
</div>
This directive should modify the item
by assigning the value item.visible=true
when the element is visible, and false otherwise.
Can this be achieved with Angular? Any suggestions?