mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-09 23:34:42 +00:00
fix docs for $window service
This commit is contained in:
parent
5690627766
commit
c4497d60bc
1 changed files with 4 additions and 4 deletions
|
|
@ -13,16 +13,16 @@ function angularServiceInject(name, fn, inject, eager) {
|
||||||
* @name angular.service.$window
|
* @name angular.service.$window
|
||||||
*
|
*
|
||||||
* @description
|
* @description
|
||||||
* Is reference to the browser's <b>window</b> object. While <b>window</b>
|
* Is reference to the browser's `window` object. While `window`
|
||||||
* is globally available in JavaScript, it causes testability problems, because
|
* is globally available in JavaScript, it causes testability problems, because
|
||||||
* it is a global variable. In <b><angular/></b> we always refer to it through the
|
* 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.
|
* `$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
|
* All expressions are evaluated with respect to current scope so they don't
|
||||||
* suffer from window globality.
|
* suffer from window globality.
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
<input ng:init="greeting='Hello World!'" type="text" name="greeting" />
|
<input ng:init="$window = $service('$window'); greeting='Hello World!'" type="text" name="greeting" />
|
||||||
<button ng:click="$window.alert(greeting)">ALERT</button>
|
<button ng:click="$window.alert(greeting)">ALERT</button>
|
||||||
*/
|
*/
|
||||||
angularServiceInject("$window", bind(window, identity, window), [], EAGER);
|
angularServiceInject("$window", bind(window, identity, window), [], EAGER);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue