Angular does a dirty check in a process called a digest. When you make a call to $scope.$digest() , it will extend to all child areas of $scope . To notify angular of changes, you usually do $scope.$apply() . At the end of $ apply () angular, a digest is executed in the root area, which launches diggest in each area of your application. Therefore, to avoid collecting data in your area with a large table area, you must make sure that it is not a child of the additional information and instead of doing $ scope. $ Apply () in your directive, you could make $ Volume. $ digest (). This can be a bit confusing, so I made a plunker that tries to show the difference. Open the console and see the difference in the scroll event and press the button:
http://plnkr.co/edit/45gKhAIt0DrozS7f0Bz2?p=preview
// this will only cause a digest in the current scope and its children angular.element($window).bind('scroll',function(){ $scope.scrollY = $window.scrollY; $scope.$digest(); }) // this will cause a digest in every scope angular.element($window).bind('scroll',function(){ $scope.scrollY = $window.scrollY; $scope.$apply(); })
When all this is said, this is a very unusual thing - and probably not a good idea for a number of reasons (angular does not scale very well with thousands of elements, you cannot use any of the angular event directives (ngClick, etc.), because they are all wrapped in $ apply), but if you cannot display the table on the server side, you can try to try.
source share