mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-04-11 02:21:00 +00:00
the flag must be in all src and test files so that we get the benefit of running in the strict mode even in jstd the following script was used to modify all files: for file in `find src test -name "*.js"`; do echo -e "'use strict';\n" > temp.txt cat $file >> temp.txt mv temp.txt $file done
51 lines
1.1 KiB
JavaScript
51 lines
1.1 KiB
JavaScript
'use strict';
|
|
|
|
var browserSingleton;
|
|
/**
|
|
* @workInProgress
|
|
* @ngdoc service
|
|
* @name angular.service.$browser
|
|
* @requires $log
|
|
*
|
|
* @description
|
|
* Represents the browser.
|
|
*/
|
|
angularService('$browser', function($log){
|
|
if (!browserSingleton) {
|
|
browserSingleton = new Browser(window, jqLite(window.document), jqLite(window.document.body),
|
|
XHR, $log);
|
|
browserSingleton.bind();
|
|
}
|
|
return browserSingleton;
|
|
}, {$inject:['$log']});
|
|
|
|
extend(angular, {
|
|
// disabled for now until we agree on public name
|
|
//'annotate': annotate,
|
|
'element': jqLite,
|
|
'compile': compile,
|
|
'scope': createScope,
|
|
'copy': copy,
|
|
'extend': extend,
|
|
'equals': equals,
|
|
'forEach': forEach,
|
|
'injector': createInjector,
|
|
'noop':noop,
|
|
'bind':bind,
|
|
'toJson': toJson,
|
|
'fromJson': fromJson,
|
|
'identity':identity,
|
|
'isUndefined': isUndefined,
|
|
'isDefined': isDefined,
|
|
'isString': isString,
|
|
'isFunction': isFunction,
|
|
'isObject': isObject,
|
|
'isNumber': isNumber,
|
|
'isArray': isArray
|
|
});
|
|
|
|
//try to bind to jquery now so that one can write angular.element().read()
|
|
//but we will rebind on bootstrap again.
|
|
bindJQuery();
|
|
|
|
|