mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 15:40:22 +00: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:
parent
c90abf057b
commit
a070ff5ad0
7 changed files with 6 additions and 8 deletions
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -10,4 +10,4 @@
|
||||||
*/
|
*/
|
||||||
angularServiceInject("$document", function(window){
|
angularServiceInject("$document", function(window){
|
||||||
return jqLite(window.document);
|
return jqLite(window.document);
|
||||||
}, ['$window'], true);
|
}, ['$window']);
|
||||||
|
|
|
||||||
|
|
@ -19,4 +19,4 @@ angularServiceInject('$exceptionHandler', $exceptionHandlerFactory = function($l
|
||||||
return function(e) {
|
return function(e) {
|
||||||
$log.error(e);
|
$log.error(e);
|
||||||
};
|
};
|
||||||
}, ['$log'], true);
|
}, ['$log']);
|
||||||
|
|
|
||||||
|
|
@ -53,4 +53,4 @@ angularServiceInject("$hover", function(browser, document) {
|
||||||
tooltip = _null;
|
tooltip = _null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, ['$browser', '$document'], true);
|
}, ['$browser', '$document']);
|
||||||
|
|
|
||||||
|
|
@ -64,4 +64,4 @@ angularServiceInject("$invalidWidgets", function(){
|
||||||
}
|
}
|
||||||
|
|
||||||
return invalidWidgets;
|
return invalidWidgets;
|
||||||
}, [], true);
|
});
|
||||||
|
|
|
||||||
|
|
@ -89,4 +89,4 @@ angularServiceInject("$log", $logFactory = function($window){
|
||||||
return logFn;
|
return logFn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, ['$window'], true);
|
}, ['$window']);
|
||||||
|
|
|
||||||
|
|
@ -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));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue