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. * @param {function()} fn A function, who's execution should be deferred.
*/ */
angularServiceInject('$defer', function($browser, $exceptionHandler, $updateView) { angularServiceInject('$defer', function($browser, $exceptionHandler, $updateView) {
var scope = this;
return function(fn) { return function(fn) {
$browser.defer(function() { $browser.defer(function() {
try { try {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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