diff options
| author | Misko Hevery | 2010-09-22 13:24:40 +0200 | 
|---|---|---|
| committer | Misko Hevery | 2010-09-22 16:17:44 +0200 | 
| commit | 0649009624e8e7bd6fb39537f62c6f00facbfb16 (patch) | |
| tree | e85077e148220ce75926bffce2d1e7daf8069945 /src/AngularPublic.js | |
| parent | eefb920d0e0345485a8eb120aeecc3b1aa9f6719 (diff) | |
| download | angular.js-0649009624e8e7bd6fb39537f62c6f00facbfb16.tar.bz2 | |
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
Diffstat (limited to 'src/AngularPublic.js')
| -rw-r--r-- | src/AngularPublic.js | 6 | 
1 files changed, 3 insertions, 3 deletions
| 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; | 
