From 6cd57fd77b2fb3497a60bcbedde169e7ef955a1e Mon Sep 17 00:00:00 2001 From: Mohammad Fares Date: Sun, 13 Dec 2015 12:50:45 +0200 Subject: [PATCH] To be minified and compressed without errors that cased by changing the parameter to an auto-naming parameter like 'a' which will not be recognised my the angular.js as $rootScope any more. --- src/Scope.SafeApply.js | 4 ++-- src/Scope.SafeApply.min.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Scope.SafeApply.js b/src/Scope.SafeApply.js index 8dc2828..c20f8ea 100644 --- a/src/Scope.SafeApply.js +++ b/src/Scope.SafeApply.js @@ -19,7 +19,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -angular.module('Scope.safeApply', []).run(function($rootScope) { +angular.module('Scope.safeApply', []).run(['$rootScope', function($rootScope) { $rootScope.$safeApply = function() { var $scope, fn, force = false; @@ -49,4 +49,4 @@ angular.module('Scope.safeApply', []).run(function($rootScope) { } }; -}); +}]); diff --git a/src/Scope.SafeApply.min.js b/src/Scope.SafeApply.min.js index 17c119d..e5c6702 100644 --- a/src/Scope.SafeApply.min.js +++ b/src/Scope.SafeApply.min.js @@ -1,6 +1,6 @@ -angular.module('Scope.safeApply',[]).run(function($rootScope){$rootScope.$safeApply=function(){var $scope,fn,force=false;if(arguments.length==1){var arg=arguments[0];if(typeof arg=='function'){fn=arg;} +angular.module('Scope.safeApply',[]).run(['$rootScope', function($rootScope){$rootScope.$safeApply=function(){var $scope,fn,force=false;if(arguments.length==1){var arg=arguments[0];if(typeof arg=='function'){fn=arg;} else{$scope=arg;}} else{$scope=arguments[0];fn=arguments[1];if(arguments.length==3){force=!!arguments[2];}} $scope=$scope||this;fn=fn||function(){};if(force||!$scope.$$phase){$scope.$apply?$scope.$apply(fn):$scope.apply(fn);} -else{fn();}};}); \ No newline at end of file +else{fn();}};}]); \ No newline at end of file