Upgrade to angularjs 1.2.0 rc1
This commit is contained in:
parent
d223dfd662
commit
d6b021bfaf
674 changed files with 79667 additions and 62269 deletions
57
lib/angular/docs/partials/api/ng.$window.html
Normal file → Executable file
57
lib/angular/docs/partials/api/ng.$window.html
Normal file → Executable file
|
@ -1,30 +1,51 @@
|
|||
<h1><code ng:non-bindable="">$window</code>
|
||||
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
|
||||
)</span>
|
||||
<a href="http://github.com/angular/angular.js/tree/v1.2.0rc1/src/ng/window.js#L3" class="view-source btn btn-action"><i class="icon-zoom-in"> </i> View source</a><a href="http://github.com/angular/angular.js/edit/master/src/ng/window.js" class="improve-docs btn btn-primary"><i class="icon-edit"> </i> Improve this doc</a><h1><code ng:non-bindable="">$window</code>
|
||||
<div><span class="hint">service in module <code ng:non-bindable="">ng</code>
|
||||
</span>
|
||||
</div>
|
||||
</h1>
|
||||
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/window.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
|
||||
<div class="description"><p>A reference to the browser's <code>window</code> object. While <code>window</code>
|
||||
<div><h2 id="Description">Description</h2>
|
||||
<div class="description"><div class="ng-window-page"><p>A reference to the browser's <code>window</code> object. While <code>window</code>
|
||||
is globally available in JavaScript, it causes testability problems, because
|
||||
it is a global variable. In angular we always refer to it through the
|
||||
<code>$window</code> service, so it may be overridden, 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>
|
||||
<p>Expressions, like the one defined for the <code>ngClick</code> directive in the example
|
||||
below, are evaluated with respect to the current scope. Therefore, there is
|
||||
no risk of inadvertently coding in a dependency on a global value in such an
|
||||
expression.</p>
|
||||
</div></div>
|
||||
<h2 id="Example">Example</h2>
|
||||
<div class="example"><h4>Source</h4>
|
||||
<div source-edit="" source-edit-deps="angular.js" source-edit-html="index.html-218" source-edit-css="" source-edit-js="" source-edit-unit="" source-edit-scenario="scenario.js-219"></div>
|
||||
<div class="example"><div class="ng-window-page"><h4>Source</h2>
|
||||
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-137" source-edit-css="" source-edit-js="script.js-136" source-edit-json="" source-edit-unit="" source-edit-scenario="scenario.js-138"></div>
|
||||
<div class="tabbable"><div class="tab-pane" title="index.html">
|
||||
<pre class="prettyprint linenums" ng-set-text="index.html-218" ng-html-wrap=" angular.js"></pre>
|
||||
<script type="text/ng-template" id="index.html-218">
|
||||
<input ng-init="$window = $service('$window'); greeting='Hello World!'" type="text" ng-model="greeting" />
|
||||
<button ng-click="$window.alert(greeting)">ALERT</button>
|
||||
<pre class="prettyprint linenums" ng-set-text="index.html-137" ng-html-wrap=" angular.js script.js"></pre>
|
||||
<script type="text/ng-template" id="index.html-137">
|
||||
|
||||
<div ng-controller="Ctrl">
|
||||
<input type="text" ng-model="greeting" />
|
||||
<button ng-click="$window.alert(greeting)">ALERT</button>
|
||||
</div>
|
||||
</script>
|
||||
</div>
|
||||
<div class="tab-pane" title="script.js">
|
||||
<pre class="prettyprint linenums" ng-set-text="script.js-136"></pre>
|
||||
<script type="text/ng-template" id="script.js-136">
|
||||
function Ctrl($scope, $window) {
|
||||
$scope.$window = $window;
|
||||
$scope.greeting = 'Hello, World!';
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
<div class="tab-pane" title="End to end test">
|
||||
<pre class="prettyprint linenums" ng-set-text="scenario.js-219"></pre>
|
||||
<script type="text/ng-template" id="scenario.js-219">
|
||||
<pre class="prettyprint linenums" ng-set-text="scenario.js-138"></pre>
|
||||
<script type="text/ng-template" id="scenario.js-138">
|
||||
it('should display the greeting in the input box', function() {
|
||||
input('greeting').enter('Hello, E2E Tests');
|
||||
// If we click the button it will block the test runner
|
||||
// element(':button').click();
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div><h4>Demo</h4>
|
||||
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-218" ng-eval-javascript=""></div></div>
|
||||
</div><h2>Demo</h4>
|
||||
<div class="well doc-example-live animate-container" ng-embed-app="" ng-set-html="index.html-137" ng-eval-javascript="script.js-136"></div>
|
||||
</div></div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue