make all built-in services lazy

now that we require DI everywhere, we don't need any of these
services to be eager - they get initialized when and only when
they are requested.
This commit is contained in:
Igor Minar
2011-02-16 20:15:06 -05:00
parent c90abf057b
commit a070ff5ad0
7 changed files with 6 additions and 8 deletions

View File

@@ -16,8 +16,6 @@
* @param {function()} fn A function, who's execution should be deferred.
*/
angularServiceInject('$defer', function($browser, $exceptionHandler, $updateView) {
var scope = this;
return function(fn) {
$browser.defer(function() {
try {

View File

@@ -10,4 +10,4 @@
*/
angularServiceInject("$document", function(window){
return jqLite(window.document);
}, ['$window'], true);
}, ['$window']);

View File

@@ -19,4 +19,4 @@ angularServiceInject('$exceptionHandler', $exceptionHandlerFactory = function($l
return function(e) {
$log.error(e);
};
}, ['$log'], true);
}, ['$log']);

View File

@@ -53,4 +53,4 @@ angularServiceInject("$hover", function(browser, document) {
tooltip = _null;
}
});
}, ['$browser', '$document'], true);
}, ['$browser', '$document']);

View File

@@ -64,4 +64,4 @@ angularServiceInject("$invalidWidgets", function(){
}
return invalidWidgets;
}, [], true);
});

View File

@@ -89,4 +89,4 @@ angularServiceInject("$log", $logFactory = function($window){
return logFn;
}
}
}, ['$window'], true);
}, ['$window']);

View File

@@ -22,4 +22,4 @@
</doc:scenario>
</doc:example>
*/
angularServiceInject("$window", bind(window, identity, window), [], true);
angularServiceInject("$window", bind(window, identity, window));