mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-01-13 08:59:54 +08:00
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:
@@ -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 {
|
||||
|
||||
@@ -10,4 +10,4 @@
|
||||
*/
|
||||
angularServiceInject("$document", function(window){
|
||||
return jqLite(window.document);
|
||||
}, ['$window'], true);
|
||||
}, ['$window']);
|
||||
|
||||
@@ -19,4 +19,4 @@ angularServiceInject('$exceptionHandler', $exceptionHandlerFactory = function($l
|
||||
return function(e) {
|
||||
$log.error(e);
|
||||
};
|
||||
}, ['$log'], true);
|
||||
}, ['$log']);
|
||||
|
||||
@@ -53,4 +53,4 @@ angularServiceInject("$hover", function(browser, document) {
|
||||
tooltip = _null;
|
||||
}
|
||||
});
|
||||
}, ['$browser', '$document'], true);
|
||||
}, ['$browser', '$document']);
|
||||
|
||||
@@ -64,4 +64,4 @@ angularServiceInject("$invalidWidgets", function(){
|
||||
}
|
||||
|
||||
return invalidWidgets;
|
||||
}, [], true);
|
||||
});
|
||||
|
||||
@@ -89,4 +89,4 @@ angularServiceInject("$log", $logFactory = function($window){
|
||||
return logFn;
|
||||
}
|
||||
}
|
||||
}, ['$window'], true);
|
||||
}, ['$window']);
|
||||
|
||||
@@ -22,4 +22,4 @@
|
||||
</doc:scenario>
|
||||
</doc:example>
|
||||
*/
|
||||
angularServiceInject("$window", bind(window, identity, window), [], true);
|
||||
angularServiceInject("$window", bind(window, identity, window));
|
||||
|
||||
Reference in New Issue
Block a user