aboutsummaryrefslogtreecommitdiffstats
path: root/src/AngularPublic.js
diff options
context:
space:
mode:
authorMisko Hevery2010-12-08 16:52:08 -0800
committerIgor Minar2011-01-04 16:40:40 -0800
commitd0270d92568e1b7c762b42a0ee0712b65d9acc5c (patch)
tree2a0f0680e6f9713c8c7a2c01d50e7a97d8b01d11 /src/AngularPublic.js
parent5f080193cbc0d84676cf267adcdc6307fb601610 (diff)
downloadangular.js-d0270d92568e1b7c762b42a0ee0712b65d9acc5c.tar.bz2
Remove many eager-publish services, lazy polling
- Browser now starts the poller on first call to addPollFn() - Many services ($location, $cookies, $router) are no longer eager-publish. The result is that unless someone needs the $cookies, they will not cause the Browser to start polling for them.
Diffstat (limited to 'src/AngularPublic.js')
-rw-r--r--src/AngularPublic.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/AngularPublic.js b/src/AngularPublic.js
index af572340..38325404 100644
--- a/src/AngularPublic.js
+++ b/src/AngularPublic.js
@@ -17,11 +17,16 @@ angularService('$browser', function($log){
XHR,
$log,
window.setTimeout);
- browserSingleton.startPoller(50, function(delay, fn){setTimeout(delay,fn);});
+ var addPollFn = browserSingleton.addPollFn;
+ browserSingleton.addPollFn = function(){
+ browserSingleton.addPollFn = addPollFn;
+ browserSingleton.startPoller(100, function(delay, fn){setTimeout(delay,fn);});
+ return addPollFn.apply(browserSingleton, arguments);
+ };
browserSingleton.bind();
}
return browserSingleton;
-}, {inject:['$log']});
+}, {$inject:['$log']});
extend(angular, {
'element': jqLite,