How to know the position of the scrollbar in a div?

Problem

I want to get the actual position (scrollY) of the scrollbar something like below. http://plnkr.co/edit/45gKhAIt0DrozS7f0Bz2?p=preview
I need to get this type of scrollY result for my div rather than the entire window. How can I do that in angularjs?

angular.element($window).bind('scroll',function(){
    console.log(' --- You scrolled - do $digest() ---')
    $scope.scrollY = $window.scrollY;
    $scope.$digest();
})
Problem courtesy of: anilCSE

Solution

Here is not angular, just standard JavaScript: .scrollTop

yourDiv.scrollTop

Example: http://jsfiddle.net/TheSharpieOne/Tf7bq/2/ (The value is logged in the console.)

UPDATE

Changed listener to listen for scroll on the div. Angular doesn't have a nice way to listen for scroll (like it does for certain other events), so a standard JavaScript event listener is used. You can wrap this in a directive to make it more angular.

New example: http://jsfiddle.net/TheSharpieOne/Tf7bq/4/

yourDiv.addEventListener('scroll',function(){

    console.log(this.scrollTop);

});
Solution courtesy of: TheSharpieOne

Discussion

There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.