I have a div with a scrollbar in it. Now I want to get an event, that triggers every time, the user scrolls.
Is that possible in AngularJS, or do I have to use jQue
You would be using jquery for adding the event listener, and maybe inside an angularjs directive to attach it to an element.
page.html:
myscroller.js:
app.directive('myScroller', function(){
return {
restrict: 'A',
link: function(scope,elem,attrs){
$(elem).on('scroll', function(evt){
console.log(evt.offsetX + ':' + evt.offsetY);
});
}
}
});
Edit: of course you don't even need to use jquery. Angular's jqLite suffices for this, you would just call element without the jquery wrapping:
elem.on('scroll', ...