Update Angular to 1.2.0 RC2
This commit is contained in:
parent
7416269494
commit
0d3a40980e
184 changed files with 17993 additions and 21133 deletions
|
@ -5,10 +5,10 @@
|
|||
<div><div class="cookbook-page cookbook-advanced-form-page"><p>Here we extend the basic form example to include common features such as reverting, dirty state
|
||||
detection, and preventing invalid form submission.</p>
|
||||
<h3>Source</h2>
|
||||
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-160" source-edit-css="" source-edit-js="script.js-159" source-edit-json="" source-edit-unit="" source-edit-scenario="scenario.js-161"></div>
|
||||
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-161" source-edit-css="" source-edit-js="script.js-160" source-edit-json="" source-edit-unit="" source-edit-scenario="scenario.js-162"></div>
|
||||
<div class="tabbable"><div class="tab-pane" title="index.html">
|
||||
<pre class="prettyprint linenums" ng-set-text="index.html-160" ng-html-wrap=" angular.js script.js"></pre>
|
||||
<script type="text/ng-template" id="index.html-160">
|
||||
<pre class="prettyprint linenums" ng-set-text="index.html-161" ng-html-wrap=" angular.js script.js"></pre>
|
||||
<script type="text/ng-template" id="index.html-161">
|
||||
|
||||
<div ng-controller="UserForm">
|
||||
|
||||
|
@ -48,8 +48,8 @@ detection, and preventing invalid form submission.</p>
|
|||
</script>
|
||||
</div>
|
||||
<div class="tab-pane" title="script.js">
|
||||
<pre class="prettyprint linenums" ng-set-text="script.js-159"></pre>
|
||||
<script type="text/ng-template" id="script.js-159">
|
||||
<pre class="prettyprint linenums" ng-set-text="script.js-160"></pre>
|
||||
<script type="text/ng-template" id="script.js-160">
|
||||
function UserForm($scope) {
|
||||
var master = {
|
||||
name: 'John Smith',
|
||||
|
@ -102,8 +102,8 @@ detection, and preventing invalid form submission.</p>
|
|||
</script>
|
||||
</div>
|
||||
<div class="tab-pane" title="End to end test">
|
||||
<pre class="prettyprint linenums" ng-set-text="scenario.js-161"></pre>
|
||||
<script type="text/ng-template" id="scenario.js-161">
|
||||
<pre class="prettyprint linenums" ng-set-text="scenario.js-162"></pre>
|
||||
<script type="text/ng-template" id="scenario.js-162">
|
||||
it('should enable save button', function() {
|
||||
expect(element(':button:contains(Save)').attr('disabled')).toBeTruthy();
|
||||
input('form.name').enter('');
|
||||
|
@ -124,7 +124,7 @@ detection, and preventing invalid form submission.</p>
|
|||
</script>
|
||||
</div>
|
||||
</div><h2>Demo</h3>
|
||||
<div class="well doc-example-live animate-container" ng-embed-app="" ng-set-html="index.html-160" ng-eval-javascript="script.js-159"></div>
|
||||
<div class="well doc-example-live animate-container" ng-embed-app="" ng-set-html="index.html-161" ng-eval-javascript="script.js-160"></div>
|
||||
<h2>Things to notice</h2>
|
||||
<ul>
|
||||
<li>Cancel & save buttons are only enabled if the form is dirty — there is something to cancel or
|
||||
|
|
|
@ -8,10 +8,10 @@ attach behavior to them. For example you can use the
|
|||
<a href="http://code.google.com/apis/buzz/v1/getting_started.html#background-operations|">Google Buzz API</a>
|
||||
to retrieve Buzz activity and comments.</p>
|
||||
<h3>Source</h2>
|
||||
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-163" source-edit-css="" source-edit-js="script.js-162" source-edit-json="" source-edit-unit="" source-edit-scenario="scenario.js-164"></div>
|
||||
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-164" source-edit-css="" source-edit-js="script.js-163" source-edit-json="" source-edit-unit="" source-edit-scenario="scenario.js-165"></div>
|
||||
<div class="tabbable"><div class="tab-pane" title="index.html">
|
||||
<pre class="prettyprint linenums" ng-set-text="index.html-163" ng-html-wrap=" angular.js script.js"></pre>
|
||||
<script type="text/ng-template" id="index.html-163">
|
||||
<pre class="prettyprint linenums" ng-set-text="index.html-164" ng-html-wrap=" angular.js script.js"></pre>
|
||||
<script type="text/ng-template" id="index.html-164">
|
||||
|
||||
<div ng-controller="BuzzController">
|
||||
<input ng-model="userId"/>
|
||||
|
@ -36,8 +36,8 @@ to retrieve Buzz activity and comments.</p>
|
|||
</script>
|
||||
</div>
|
||||
<div class="tab-pane" title="script.js">
|
||||
<pre class="prettyprint linenums" ng-set-text="script.js-162"></pre>
|
||||
<script type="text/ng-template" id="script.js-162">
|
||||
<pre class="prettyprint linenums" ng-set-text="script.js-163"></pre>
|
||||
<script type="text/ng-template" id="script.js-163">
|
||||
BuzzController.$inject = ['$scope', '$resource'];
|
||||
function BuzzController($scope, $resource) {
|
||||
$scope.userId = 'googlebuzz';
|
||||
|
@ -59,8 +59,8 @@ to retrieve Buzz activity and comments.</p>
|
|||
</script>
|
||||
</div>
|
||||
<div class="tab-pane" title="End to end test">
|
||||
<pre class="prettyprint linenums" ng-set-text="scenario.js-164"></pre>
|
||||
<script type="text/ng-template" id="scenario.js-164">
|
||||
<pre class="prettyprint linenums" ng-set-text="scenario.js-165"></pre>
|
||||
<script type="text/ng-template" id="scenario.js-165">
|
||||
xit('fetch buzz and expand', function() {
|
||||
element(':button:contains(fetch)').click();
|
||||
expect(repeater('div.buzz').count()).toBeGreaterThan(0);
|
||||
|
@ -70,5 +70,5 @@ to retrieve Buzz activity and comments.</p>
|
|||
</script>
|
||||
</div>
|
||||
</div><h2>Demo</h3>
|
||||
<div class="well doc-example-live animate-container" ng-embed-app="" ng-set-html="index.html-163" ng-eval-javascript="script.js-162"></div>
|
||||
<div class="well doc-example-live animate-container" ng-embed-app="" ng-set-html="index.html-164" ng-eval-javascript="script.js-163"></div>
|
||||
</div></div>
|
||||
|
|
|
@ -25,10 +25,10 @@ controller.</p>
|
|||
<li>Settings: url <code>settings</code> Show an edit screen for user contact information.</li>
|
||||
</ul>
|
||||
<h3>Source</h2>
|
||||
<div source-edit="deepLinking" source-edit-deps="angular.js angular-route.js angular-sanitize.js script.js" source-edit-html="index.html-170 settings.html welcome.html" source-edit-css="style.css-169" source-edit-js="script.js-168" source-edit-json="" source-edit-unit="" source-edit-scenario="scenario.js-171"></div>
|
||||
<div source-edit="deepLinking" source-edit-deps="angular.js angular-route.js angular-sanitize.js script.js" source-edit-html="index.html-168 settings.html welcome.html" source-edit-css="style.css-167" source-edit-js="script.js-166" source-edit-json="" source-edit-unit="" source-edit-scenario="scenario.js-169"></div>
|
||||
<div class="tabbable"><div class="tab-pane" title="index.html">
|
||||
<pre class="prettyprint linenums" ng-set-text="index.html-170" ng-html-wrap="deepLinking angular.js angular-route.js angular-sanitize.js script.js"></pre>
|
||||
<script type="text/ng-template" id="index.html-170">
|
||||
<pre class="prettyprint linenums" ng-set-text="index.html-168" ng-html-wrap="deepLinking angular.js angular-route.js angular-sanitize.js script.js"></pre>
|
||||
<script type="text/ng-template" id="index.html-168">
|
||||
<div ng-controller="AppCntl">
|
||||
<h1>Your App Chrome</h1>
|
||||
[ <a href="welcome">Welcome</a> | <a href="settings">Settings</a> ]
|
||||
|
@ -77,8 +77,8 @@ controller.</p>
|
|||
</script>
|
||||
</div>
|
||||
<div class="tab-pane" title="style.css">
|
||||
<pre class="prettyprint linenums" ng-set-text="style.css-169"></pre>
|
||||
<style type="text/css" id="style.css-169">
|
||||
<pre class="prettyprint linenums" ng-set-text="style.css-167"></pre>
|
||||
<style type="text/css" id="style.css-167">
|
||||
[ng-view] {
|
||||
border: 1px solid blue;
|
||||
margin: 0;
|
||||
|
@ -93,8 +93,8 @@ controller.</p>
|
|||
</style>
|
||||
</div>
|
||||
<div class="tab-pane" title="script.js">
|
||||
<pre class="prettyprint linenums" ng-set-text="script.js-168"></pre>
|
||||
<script type="text/ng-template" id="script.js-168">
|
||||
<pre class="prettyprint linenums" ng-set-text="script.js-166"></pre>
|
||||
<script type="text/ng-template" id="script.js-166">
|
||||
angular.module('deepLinking', ['ngRoute', 'ngSanitize'])
|
||||
.config(function($routeProvider) {
|
||||
$routeProvider.
|
||||
|
@ -134,8 +134,8 @@ controller.</p>
|
|||
</script>
|
||||
</div>
|
||||
<div class="tab-pane" title="End to end test">
|
||||
<pre class="prettyprint linenums" ng-set-text="scenario.js-171"></pre>
|
||||
<script type="text/ng-template" id="scenario.js-171">
|
||||
<pre class="prettyprint linenums" ng-set-text="scenario.js-169"></pre>
|
||||
<script type="text/ng-template" id="scenario.js-169">
|
||||
it('should navigate to URL', function() {
|
||||
element('a:contains(Welcome)').click();
|
||||
expect(element('[ng-view]').text()).toMatch(/Hello anonymous/);
|
||||
|
@ -148,7 +148,7 @@ controller.</p>
|
|||
</script>
|
||||
</div>
|
||||
</div><h2>Demo</h3>
|
||||
<div class="well doc-example-live animate-container" ng-embed-app="deepLinking" ng-set-html="index.html-170" ng-eval-javascript="script.js-168"></div>
|
||||
<div class="well doc-example-live animate-container" ng-embed-app="deepLinking" ng-set-html="index.html-168" ng-eval-javascript="script.js-166"></div>
|
||||
<h1>Things to notice</h2>
|
||||
<ul>
|
||||
<li>Routes are defined in the <code>AppCntl</code> class. The initialization of the controller causes the
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
to make both of these operations trivial. This example shows off how you can build a simple form to
|
||||
allow a user to enter data.</p>
|
||||
<h3>Source</h2>
|
||||
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-173" source-edit-css="" source-edit-js="script.js-172" source-edit-json="" source-edit-unit="" source-edit-scenario="scenario.js-174"></div>
|
||||
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-171" source-edit-css="" source-edit-js="script.js-170" source-edit-json="" source-edit-unit="" source-edit-scenario="scenario.js-172"></div>
|
||||
<div class="tabbable"><div class="tab-pane" title="index.html">
|
||||
<pre class="prettyprint linenums" ng-set-text="index.html-173" ng-html-wrap=" angular.js script.js"></pre>
|
||||
<script type="text/ng-template" id="index.html-173">
|
||||
<pre class="prettyprint linenums" ng-set-text="index.html-171" ng-html-wrap=" angular.js script.js"></pre>
|
||||
<script type="text/ng-template" id="index.html-171">
|
||||
|
||||
<div ng-controller="FormController" class="example">
|
||||
|
||||
|
@ -44,8 +44,8 @@ allow a user to enter data.</p>
|
|||
</script>
|
||||
</div>
|
||||
<div class="tab-pane" title="script.js">
|
||||
<pre class="prettyprint linenums" ng-set-text="script.js-172"></pre>
|
||||
<script type="text/ng-template" id="script.js-172">
|
||||
<pre class="prettyprint linenums" ng-set-text="script.js-170"></pre>
|
||||
<script type="text/ng-template" id="script.js-170">
|
||||
function FormController($scope) {
|
||||
var user = $scope.user = {
|
||||
name: 'John Smith',
|
||||
|
@ -70,8 +70,8 @@ allow a user to enter data.</p>
|
|||
</script>
|
||||
</div>
|
||||
<div class="tab-pane" title="End to end test">
|
||||
<pre class="prettyprint linenums" ng-set-text="scenario.js-174"></pre>
|
||||
<script type="text/ng-template" id="scenario.js-174">
|
||||
<pre class="prettyprint linenums" ng-set-text="scenario.js-172"></pre>
|
||||
<script type="text/ng-template" id="scenario.js-172">
|
||||
it('should show debug', function() {
|
||||
expect(binding('user')).toMatch(/John Smith/);
|
||||
});
|
||||
|
@ -107,7 +107,7 @@ allow a user to enter data.</p>
|
|||
</script>
|
||||
</div>
|
||||
</div><h2>Demo</h3>
|
||||
<div class="well doc-example-live animate-container" ng-embed-app="" ng-set-html="index.html-173" ng-eval-javascript="script.js-172"></div>
|
||||
<div class="well doc-example-live animate-container" ng-embed-app="" ng-set-html="index.html-171" ng-eval-javascript="script.js-170"></div>
|
||||
<h2>Things to notice</h2>
|
||||
<ul>
|
||||
<li>The user data model is initialized <a href="api/ng.directive:ngController"><code>controller</code></a> and is
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
</div>
|
||||
</h1>
|
||||
<div><div class="cookbook-page cookbook-hello-world-page"><h3>Source</h2>
|
||||
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-166" source-edit-css="" source-edit-js="script.js-165" source-edit-json="" source-edit-unit="" source-edit-scenario="scenario.js-167"></div>
|
||||
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-174" source-edit-css="" source-edit-js="script.js-173" source-edit-json="" source-edit-unit="" source-edit-scenario="scenario.js-175"></div>
|
||||
<div class="tabbable"><div class="tab-pane" title="index.html">
|
||||
<pre class="prettyprint linenums" ng-set-text="index.html-166" ng-html-wrap=" angular.js script.js"></pre>
|
||||
<script type="text/ng-template" id="index.html-166">
|
||||
<pre class="prettyprint linenums" ng-set-text="index.html-174" ng-html-wrap=" angular.js script.js"></pre>
|
||||
<script type="text/ng-template" id="index.html-174">
|
||||
|
||||
<div ng-controller="HelloCntl">
|
||||
Your name: <input type="text" ng-model="name"/>
|
||||
|
@ -16,16 +16,16 @@
|
|||
</script>
|
||||
</div>
|
||||
<div class="tab-pane" title="script.js">
|
||||
<pre class="prettyprint linenums" ng-set-text="script.js-165"></pre>
|
||||
<script type="text/ng-template" id="script.js-165">
|
||||
<pre class="prettyprint linenums" ng-set-text="script.js-173"></pre>
|
||||
<script type="text/ng-template" id="script.js-173">
|
||||
function HelloCntl($scope) {
|
||||
$scope.name = 'World';
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
<div class="tab-pane" title="End to end test">
|
||||
<pre class="prettyprint linenums" ng-set-text="scenario.js-167"></pre>
|
||||
<script type="text/ng-template" id="scenario.js-167">
|
||||
<pre class="prettyprint linenums" ng-set-text="scenario.js-175"></pre>
|
||||
<script type="text/ng-template" id="scenario.js-175">
|
||||
it('should change the binding when user enters text', function() {
|
||||
expect(binding('name')).toEqual('World');
|
||||
input('name').enter('angular');
|
||||
|
@ -34,7 +34,7 @@
|
|||
</script>
|
||||
</div>
|
||||
</div><h2>Demo</h3>
|
||||
<div class="well doc-example-live animate-container" ng-embed-app="" ng-set-html="index.html-166" ng-eval-javascript="script.js-165"></div>
|
||||
<div class="well doc-example-live animate-container" ng-embed-app="" ng-set-html="index.html-174" ng-eval-javascript="script.js-173"></div>
|
||||
<h2>Things to notice</h2>
|
||||
<p>Take a look through the source and note:</p>
|
||||
<ul>
|
||||
|
|
|
@ -10,10 +10,10 @@ This makes it very easy to test the controller in isolation since one can simply
|
|||
controller and test without a view, because there is no connection between the controller and the
|
||||
view.</p>
|
||||
<h3>Source</h2>
|
||||
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-176" source-edit-css="" source-edit-js="script.js-175" source-edit-json="" source-edit-unit="" source-edit-scenario="scenario.js-177"></div>
|
||||
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-177" source-edit-css="" source-edit-js="script.js-176" source-edit-json="" source-edit-unit="" source-edit-scenario="scenario.js-178"></div>
|
||||
<div class="tabbable"><div class="tab-pane" title="index.html">
|
||||
<pre class="prettyprint linenums" ng-set-text="index.html-176" ng-html-wrap=" angular.js script.js"></pre>
|
||||
<script type="text/ng-template" id="index.html-176">
|
||||
<pre class="prettyprint linenums" ng-set-text="index.html-177" ng-html-wrap=" angular.js script.js"></pre>
|
||||
<script type="text/ng-template" id="index.html-177">
|
||||
|
||||
|
||||
<h4>Tic-Tac-Toe</h4>
|
||||
|
@ -31,8 +31,8 @@ view.</p>
|
|||
</script>
|
||||
</div>
|
||||
<div class="tab-pane" title="script.js">
|
||||
<pre class="prettyprint linenums" ng-set-text="script.js-175"></pre>
|
||||
<script type="text/ng-template" id="script.js-175">
|
||||
<pre class="prettyprint linenums" ng-set-text="script.js-176"></pre>
|
||||
<script type="text/ng-template" id="script.js-176">
|
||||
function TicTacToeCntl($scope, $location) {
|
||||
$scope.cellStyle= {
|
||||
'height': '20px',
|
||||
|
@ -99,8 +99,8 @@ view.</p>
|
|||
</script>
|
||||
</div>
|
||||
<div class="tab-pane" title="End to end test">
|
||||
<pre class="prettyprint linenums" ng-set-text="scenario.js-177"></pre>
|
||||
<script type="text/ng-template" id="scenario.js-177">
|
||||
<pre class="prettyprint linenums" ng-set-text="scenario.js-178"></pre>
|
||||
<script type="text/ng-template" id="scenario.js-178">
|
||||
it('should play a game', function() {
|
||||
piece(1, 1);
|
||||
expect(binding('nextMove')).toEqual('O');
|
||||
|
@ -118,7 +118,7 @@ view.</p>
|
|||
</script>
|
||||
</div>
|
||||
</div><h2>Demo</h3>
|
||||
<div class="well doc-example-live animate-container" ng-embed-app="" ng-set-html="index.html-176" ng-eval-javascript="script.js-175"></div>
|
||||
<div class="well doc-example-live animate-container" ng-embed-app="" ng-set-html="index.html-177" ng-eval-javascript="script.js-176"></div>
|
||||
<h2>Things to notice</h2>
|
||||
<ul>
|
||||
<li>The controller is defined in JavaScript and has no reference to the rendering logic.</li>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue