Use $scope instead of scope in directives

This commit is contained in:
Blade Barringer
2015-08-22 16:59:35 -05:00
parent 5e510aade0
commit 6b7ca3e823
8 changed files with 23 additions and 22 deletions

View File

@@ -6,12 +6,12 @@
.directive('whenScrolled', whenScrolled);
function whenScrolled() {
return function(scope, elm, attr) {
return function($scope, elm, attr) {
var raw = elm[0];
elm.bind('scroll', function() {
if (raw.scrollTop + raw.offsetHeight >= raw.scrollHeight) {
scope.$apply(attr.whenScrolled);
$scope.$apply(attr.whenScrolled);
}
});
};