kamilkp / angular-vs-repeat

Virtual Scroll for AngularJS ngRepeat directive
http://kamilkp.github.io/angular-vs-repeat/
MIT License
818 stars 228 forks source link

why not use $digest instead of $apply? #60

Open MaestroJurko opened 9 years ago

MaestroJurko commented 9 years ago

Why not use $digest in scroll, it is faster then $apply, but you cannot use the new setting latch, because that slows it down.

       if (updateInnerCollection()) {
            $scope.$digest();
            // $scope.$apply();
            $scope.$broadcast('vsSetOffset-refresh');
      }
jramoyo commented 8 years ago

I agree. For large applications, the scroll performance degrades significantly when using $scope.$apply().

From AngularJS Batarang:

$scope.$apply() apply

$scope.$digest() digest