forked from angular/code.angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangular.service.$window.html
23 lines (22 loc) · 1.09 KB
/
angular.service.$window.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<h1>angular.service.$window</h1>
<div class="angular-service-window"><fieldset class="workInProgress"><legend>Work in Progress</legend>
This page is currently being revised. It might be incomplete or contain inaccuracies.</fieldset>
<h2>Description</h2>
<div class="description"><p>Is reference to the browser's <b>window</b> object. While <b>window</b>
is globally available in JavaScript, it causes testability problems, because
it is a global variable. In <b><tt><angular/></tt></b> we always refer to it through the
$window service, so it may be overriden, removed or mocked for testing.</p>
<p>All expressions are evaluated with respect to current scope so they don't
suffer from window globality.</p></div>
<h2>Dependencies</h2>
<ul class="dependencies"></ul>
<h2>Methods</h2>
<ul class="methods"></ul>
<h2>Properties</h2>
<ul class="properties"></ul>
<h2>Example</h2>
<div class="example"><doc:example><doc:source><input ng:init="greeting='Hello World!'" type="text" name="greeting" />
<button ng:click="$window.alert(greeting)">ALERT</button></doc:source>
</doc:example>
</div>
</div>