Skip to content

$safeApply() defined on the $rootScope's prototype via decorator for better performance

Notifications You must be signed in to change notification settings

PatrickJS/angular-safeapply

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

angular-safeapply

$safeApply defined on the $rootScope's prototype via decorator for better performance

$scope.safeApply(function() {
  alert("I'm safe from $apply 'already in progress'");
});
//use by itself
$scope.$safeApply();

//tell it which scope to update
$scope.$safeApply($scope);
$scope.$safeApply($anotherScope);

//pass in an update function that gets called when the digest is going on...
$scope.$safeApply(function() {

});

//pass in both a scope and a function
$scope.$safeApply($anotherScope,function() {

});

//call it on the rootScope
$rootScope.$safeApply();
$rootScope.$safeApply($rootScope);
$rootScope.$safeApply($scope);
$rootScope.$safeApply($scope, fn);
$rootScope.$safeApply(fn);

About

$safeApply() defined on the $rootScope's prototype via decorator for better performance

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published