From 0649009624e8e7bd6fb39537f62c6f00facbfb16 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Wed, 22 Sep 2010 13:24:40 +0200 Subject: Refactored the Browser: - change from using prototype to inner functions to help with better compression - removed watchers (url/cookie) and introduced a poller concept - moved the checking of URL and cookie into services which register with poolers Benefits: - Smaller minified file - can call $browser.poll() from tests to simulate polling - single place where setTimeout needs to be tested - More testable $browser --- src/AngularPublic.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/AngularPublic.js') diff --git a/src/AngularPublic.js b/src/AngularPublic.js index e9f20b59..40425b8d 100644 --- a/src/AngularPublic.js +++ b/src/AngularPublic.js @@ -4,9 +4,9 @@ angularService('$browser', function browserFactory(){ browserSingleton = new Browser( window.location, jqLite(window.document), - jqLite(window.document.getElementsByTagName('head')[0])); - browserSingleton.startUrlWatcher(); - browserSingleton.startCookieWatcher(); + jqLite(window.document.getElementsByTagName('head')[0]), + XHR); + browserSingleton.startPoller(50, function(delay, fn){setTimeout(delay,fn);}); browserSingleton.bind(); } return browserSingleton; -- cgit v1.2.3