html - Detect if user is scrolling within a div -


i searched way detect if user scrolling within div angularjs. looked on documentation (https://docs.angularjs.org/api?phpsessid=cae8e98e7ca559b4605d75c813b358ee) , searched ng-click, didn't find regarding scrolling there. there no easy way this? this:

<div ng-scroll="ctrl.dosomething()"> </div> 

i know, ng-scroll doesn't exist. wrote example. ideas without external plugins or directives have include?

thanks.

you can make own custome directive like:

.directive("ngscroll", function ($window) {     return function(scope, element, attrs) {          angular.element($window).bind("scroll", function() {             console.log('do something!');              scope.$apply();         });     }; }); 

and use this:

<div ng-scroll> </div> 

Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -