diff options
| author | Misko Hevery | 2010-04-05 11:46:53 -0700 | 
|---|---|---|
| committer | Misko Hevery | 2010-04-05 11:46:53 -0700 | 
| commit | 7a4b48020688060debe9cb0f9c17615d7585cbe7 (patch) | |
| tree | 48a5b1d8cf92bb272028a106ab9ea3ec16f477a2 /src/AngularPublic.js | |
| parent | 4bfa4e230d5ebdd582068effe7f4f1b60c43093a (diff) | |
| download | angular.js-7a4b48020688060debe9cb0f9c17615d7585cbe7.tar.bz2 | |
added ng:switch widget
Diffstat (limited to 'src/AngularPublic.js')
| -rw-r--r-- | src/AngularPublic.js | 35 | 
1 files changed, 35 insertions, 0 deletions
diff --git a/src/AngularPublic.js b/src/AngularPublic.js new file mode 100644 index 00000000..470eb258 --- /dev/null +++ b/src/AngularPublic.js @@ -0,0 +1,35 @@ +var browserSingleton; +angularService('$browser', function browserFactory(){ +  if (!browserSingleton) { +    var XHR = XMLHttpRequest; +    if (isUndefined(XHR)) { +      XHR = function () { +        try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch (e1) {} +        try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch (e2) {} +        try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e3) {} +        throw new Error("This browser does not support XMLHttpRequest."); +      }; +    } +    browserSingleton = new Browser(window.location, XHR); +    browserSingleton.startUrlWatcher(); +  } +  return browserSingleton; +}); + +extend(angular, { +  'element': jqLite, +  'compile': compile, +  'scope': createScope, +  'copy': copy, +  'extend': extend, +  'foreach': foreach, +  'noop':noop, +  'identity':identity, +  'isUndefined': isUndefined, +  'isDefined': isDefined, +  'isString': isString, +  'isFunction': isFunction, +  'isNumber': isNumber, +  'isArray': isArray +}); +  | 
