mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-05-09 03:58:12 +08: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
28 lines
887 B
JavaScript
28 lines
887 B
JavaScript
'use strict';
|
|
|
|
/**
|
|
* @workInProgress
|
|
* @ngdoc service
|
|
* @name angular.service.$window
|
|
*
|
|
* @description
|
|
* A reference to the browser's `window` object. While `window`
|
|
* is globally available in JavaScript, it causes testability problems, because
|
|
* it is a global variable. In angular we always refer to it through the
|
|
* `$window` service, so it may be overriden, removed or mocked for testing.
|
|
*
|
|
* All expressions are evaluated with respect to current scope so they don't
|
|
* suffer from window globality.
|
|
*
|
|
* @example
|
|
<doc:example>
|
|
<doc:source>
|
|
<input ng:init="$window = $service('$window'); greeting='Hello World!'" type="text" name="greeting" />
|
|
<button ng:click="$window.alert(greeting)">ALERT</button>
|
|
</doc:source>
|
|
<doc:scenario>
|
|
</doc:scenario>
|
|
</doc:example>
|
|
*/
|
|
angularServiceInject("$window", bind(window, identity, window));
|