Update to Angular 1.1.4
This commit is contained in:
parent
72a485d6e8
commit
f5fc1369ad
585 changed files with 48055 additions and 3041 deletions
46
lib/angular/docs/partials/guide/expression.html
Normal file → Executable file
46
lib/angular/docs/partials/guide/expression.html
Normal file → Executable file
|
@ -1,7 +1,7 @@
|
|||
<h1><code ng:non-bindable=""></code>
|
||||
<span class="hint"></span>
|
||||
</h1>
|
||||
<div><p>Expressions are JavaScript-like code snippets that are usually placed in bindings such as <code>{{
|
||||
<div><a href="http://github.com/angular/angular.js/edit/master/docs/content/guide/expression.ngdoc" class="improve-docs btn btn-primary">Improve this doc</a><p>Expressions are JavaScript-like code snippets that are usually placed in bindings such as <code>{{
|
||||
expression }}</code>. Expressions are processed by <a href="api/ng.$parse"><code>$parse</code></a>
|
||||
service.</p>
|
||||
|
||||
|
@ -38,31 +38,31 @@ JavaScript, use the <a href="api/ng.$rootScope.Scope#$eval"><code><code>$eval()<
|
|||
<h3>Example</h3>
|
||||
|
||||
<h3>Source</h3>
|
||||
<div source-edit="" source-edit-deps="angular.js" source-edit-html="index.html-50" source-edit-css="" source-edit-js="" source-edit-unit="" source-edit-scenario="scenario.js-51"></div>
|
||||
<div source-edit="" source-edit-deps="angular.js" source-edit-html="index.html-60" source-edit-css="" source-edit-js="" source-edit-unit="" source-edit-scenario="scenario.js-61"></div>
|
||||
<div class="tabbable"><div class="tab-pane" title="index.html">
|
||||
<pre class="prettyprint linenums" ng-set-text="index.html-50" ng-html-wrap=" angular.js"></pre>
|
||||
<script type="text/ng-template" id="index.html-50">
|
||||
<pre class="prettyprint linenums" ng-set-text="index.html-60" ng-html-wrap=" angular.js"></pre>
|
||||
<script type="text/ng-template" id="index.html-60">
|
||||
1+2={{1+2}}
|
||||
</script>
|
||||
</div>
|
||||
<div class="tab-pane" title="End to end test">
|
||||
<pre class="prettyprint linenums" ng-set-text="scenario.js-51"></pre>
|
||||
<script type="text/ng-template" id="scenario.js-51">
|
||||
<pre class="prettyprint linenums" ng-set-text="scenario.js-61"></pre>
|
||||
<script type="text/ng-template" id="scenario.js-61">
|
||||
it('should calculate expression in binding', function() {
|
||||
expect(binding('1+2')).toEqual('3');
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div><h3>Demo</h3>
|
||||
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-50" ng-eval-javascript=""></div>
|
||||
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-60" ng-eval-javascript=""></div>
|
||||
|
||||
<p>You can try evaluating different expressions here:</p>
|
||||
|
||||
<h3>Source</h3>
|
||||
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-53" source-edit-css="" source-edit-js="script.js-52" source-edit-unit="" source-edit-scenario="scenario.js-54"></div>
|
||||
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-63" source-edit-css="" source-edit-js="script.js-62" source-edit-unit="" source-edit-scenario="scenario.js-64"></div>
|
||||
<div class="tabbable"><div class="tab-pane" title="index.html">
|
||||
<pre class="prettyprint linenums" ng-set-text="index.html-53" ng-html-wrap=" angular.js script.js"></pre>
|
||||
<script type="text/ng-template" id="index.html-53">
|
||||
<pre class="prettyprint linenums" ng-set-text="index.html-63" ng-html-wrap=" angular.js script.js"></pre>
|
||||
<script type="text/ng-template" id="index.html-63">
|
||||
|
||||
<div ng-controller="Cntl2" class="expressions">
|
||||
Expression:
|
||||
|
@ -78,8 +78,8 @@ JavaScript, use the <a href="api/ng.$rootScope.Scope#$eval"><code><code>$eval()<
|
|||
</script>
|
||||
</div>
|
||||
<div class="tab-pane" title="script.js">
|
||||
<pre class="prettyprint linenums" ng-set-text="script.js-52"></pre>
|
||||
<script type="text/ng-template" id="script.js-52">
|
||||
<pre class="prettyprint linenums" ng-set-text="script.js-62"></pre>
|
||||
<script type="text/ng-template" id="script.js-62">
|
||||
function Cntl2($scope) {
|
||||
var exprs = $scope.exprs = [];
|
||||
$scope.expr = '3*10|currency';
|
||||
|
@ -94,8 +94,8 @@ JavaScript, use the <a href="api/ng.$rootScope.Scope#$eval"><code><code>$eval()<
|
|||
</script>
|
||||
</div>
|
||||
<div class="tab-pane" title="End to end test">
|
||||
<pre class="prettyprint linenums" ng-set-text="scenario.js-54"></pre>
|
||||
<script type="text/ng-template" id="scenario.js-54">
|
||||
<pre class="prettyprint linenums" ng-set-text="scenario.js-64"></pre>
|
||||
<script type="text/ng-template" id="scenario.js-64">
|
||||
it('should allow user expression testing', function() {
|
||||
element('.expressions :button').click();
|
||||
var li = using('.expressions ul').repeater('li');
|
||||
|
@ -105,7 +105,7 @@ JavaScript, use the <a href="api/ng.$rootScope.Scope#$eval"><code><code>$eval()<
|
|||
</script>
|
||||
</div>
|
||||
</div><h3>Demo</h3>
|
||||
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-53" ng-eval-javascript="script.js-52"></div>
|
||||
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-63" ng-eval-javascript="script.js-62"></div>
|
||||
|
||||
<h2>Property Evaluation</h2>
|
||||
|
||||
|
@ -115,10 +115,10 @@ defined on <code>window</code>, in an expression you must use <code>$window.aler
|
|||
prevent accidental access to the global state (a common source of subtle bugs).</p>
|
||||
|
||||
<h3>Source</h3>
|
||||
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-56" source-edit-css="" source-edit-js="script.js-55" source-edit-unit="" source-edit-scenario="scenario.js-57"></div>
|
||||
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-66" source-edit-css="" source-edit-js="script.js-65" source-edit-unit="" source-edit-scenario="scenario.js-67"></div>
|
||||
<div class="tabbable"><div class="tab-pane" title="index.html">
|
||||
<pre class="prettyprint linenums" ng-set-text="index.html-56" ng-html-wrap=" angular.js script.js"></pre>
|
||||
<script type="text/ng-template" id="index.html-56">
|
||||
<pre class="prettyprint linenums" ng-set-text="index.html-66" ng-html-wrap=" angular.js script.js"></pre>
|
||||
<script type="text/ng-template" id="index.html-66">
|
||||
|
||||
<div class="example2" ng-controller="Cntl1">
|
||||
Name: <input ng-model="name" type="text"/>
|
||||
|
@ -127,8 +127,8 @@ prevent accidental access to the global state (a common source of subtle bugs).<
|
|||
</script>
|
||||
</div>
|
||||
<div class="tab-pane" title="script.js">
|
||||
<pre class="prettyprint linenums" ng-set-text="script.js-55"></pre>
|
||||
<script type="text/ng-template" id="script.js-55">
|
||||
<pre class="prettyprint linenums" ng-set-text="script.js-65"></pre>
|
||||
<script type="text/ng-template" id="script.js-65">
|
||||
function Cntl1($window, $scope){
|
||||
$scope.name = 'World';
|
||||
|
||||
|
@ -139,8 +139,8 @@ prevent accidental access to the global state (a common source of subtle bugs).<
|
|||
</script>
|
||||
</div>
|
||||
<div class="tab-pane" title="End to end test">
|
||||
<pre class="prettyprint linenums" ng-set-text="scenario.js-57"></pre>
|
||||
<script type="text/ng-template" id="scenario.js-57">
|
||||
<pre class="prettyprint linenums" ng-set-text="scenario.js-67"></pre>
|
||||
<script type="text/ng-template" id="scenario.js-67">
|
||||
it('should calculate expression in binding', function() {
|
||||
var alertText;
|
||||
this.addFutureAction('set mock', function($window, $document, done) {
|
||||
|
@ -157,7 +157,7 @@ prevent accidental access to the global state (a common source of subtle bugs).<
|
|||
</script>
|
||||
</div>
|
||||
</div><h3>Demo</h3>
|
||||
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-56" ng-eval-javascript="script.js-55"></div>
|
||||
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-66" ng-eval-javascript="script.js-65"></div>
|
||||
|
||||
<h3>Forgiving</h3>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue