From e0ee3a0726f43972244e400863a6dcf567f00a0e Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Tue, 7 Jun 2011 23:13:44 +0200 Subject: Update latest docs content from gdocs --- docs/content/cookbook/advancedform.ngdoc | 149 +++++++++++++++---------------- docs/content/cookbook/buzz.ngdoc | 2 +- docs/content/cookbook/form.ngdoc | 16 +--- docs/content/cookbook/mvc.ngdoc | 93 +++++++++---------- docs/content/tutorial/step_04.ngdoc | 4 +- docs/content/tutorial/step_08.ngdoc | 2 +- docs/content/tutorial/step_10.ngdoc | 2 +- docs/content/tutorial/step_11.ngdoc | 2 +- 8 files changed, 129 insertions(+), 141 deletions(-) (limited to 'docs/content') diff --git a/docs/content/cookbook/advancedform.ngdoc b/docs/content/cookbook/advancedform.ngdoc index e14be8b4..b376cbee 100644 --- a/docs/content/cookbook/advancedform.ngdoc +++ b/docs/content/cookbook/advancedform.ngdoc @@ -9,80 +9,80 @@ detection, and preventing invalid form submission. - - -
- - -
-

- - -
-
- , - - + +
+ + +
+

+ + +
+
+ , + +

- - [ add ] -
- - - [ X ] -
- - + -
- Debug View: -
form={{form}}
-    master={{master}}
-
- - +
+ Debug View: +
form={{form}}
+   master={{master}}
+
+
+ it('should enable save button', function(){ expect(element(':button:contains(Save)').attr('disabled')).toBeTruthy(); input('form.name').enter(''); @@ -100,7 +100,7 @@ master.$equals(form)}}">Save expect(element(':button:contains(Cancel)').attr('disabled')).toBeTruthy(); expect(element(':input[name=form.name]').val()).toEqual('John Smith'); }); - +
@@ -109,15 +109,10 @@ master.$equals(form)}}">Save #Things to notice -* Cancel & save buttons are only enabled if the form is dirty -- there is something to cancel or - save. +* Cancel & save buttons are only enabled if the form is dirty — there is something to cancel or +save. * Save button is only enabled if there are no validation errors on the form. * Cancel reverts the form changes back to original state. * Save updates the internal model of the form. * Debug view shows the two models. One presented to the user form and the other being the pristine - copy master. - - - - - +copy master. diff --git a/docs/content/cookbook/buzz.ngdoc b/docs/content/cookbook/buzz.ngdoc index 52fa5647..f67b4d89 100644 --- a/docs/content/cookbook/buzz.ngdoc +++ b/docs/content/cookbook/buzz.ngdoc @@ -43,7 +43,7 @@ to retrieve Buzz activity and comments. {{item.actor.name}} - Expand replies: {{item.links.replies.count}} + Expand replies: {{item.links.replies[0].count}} {{item.object.content | html}} diff --git a/docs/content/cookbook/form.ngdoc b/docs/content/cookbook/form.ngdoc index a224505f..55aeb4b9 100644 --- a/docs/content/cookbook/form.ngdoc +++ b/docs/content/cookbook/form.ngdoc @@ -78,27 +78,19 @@ ng:validate="regexp:zip"/>

it('should validate zip', function(){ expect(using('.example').element(':input[name=user.address.zip]').attr('className')) - .not().toMatch(/ng-validation-error/) - - + .not().toMatch(/ng-validation-error/); using('.example').input('user.address.zip').enter('abc'); - - expect(using('.example').element(':input[name=user.address.zip]').attr('className')) - .toMatch(/ng-validation-error/) + .toMatch(/ng-validation-error/); }); it('should validate state', function(){ expect(using('.example').element(':input[name=user.address.state]').attr('className')) - .not().toMatch(/ng-validation-error/) - - + .not().toMatch(/ng-validation-error/); using('.example').input('user.address.state').enter('XXX'); - - expect(using('.example').element(':input[name=user.address.state]').attr('className')) - .toMatch(/ng-validation-error/) + .toMatch(/ng-validation-error/); }); diff --git a/docs/content/cookbook/mvc.ngdoc b/docs/content/cookbook/mvc.ngdoc index bc0eb653..04feffcc 100644 --- a/docs/content/cookbook/mvc.ngdoc +++ b/docs/content/cookbook/mvc.ngdoc @@ -17,7 +17,7 @@ no connection between the controller and the view. - + + +

Tic-Tac-Toe

Next Player: {{nextMove}}
Player {{winner}} has won!
- - - - -
{{cell}}
- + + + + +
{{cell}}
+
-
- - it('should play a game', function(){ - piece(1, 1); - expect(binding('nextMove')).toEqual('O'); - piece(3, 1); - expect(binding('nextMove')).toEqual('X'); - piece(1, 2); - piece(3, 2); - piece(1, 3); - expect(element('.winner').text()).toEqual('Player X has won!'); - }); - - - function piece(row, col) { - element('.board tr:nth-child('+row+') td:nth-child('+col+')').click(); - } - +
+ + it('should play a game', function(){ + piece(1, 1); + expect(binding('nextMove')).toEqual('O'); + piece(3, 1); + expect(binding('nextMove')).toEqual('X'); + piece(1, 2); + piece(3, 2); + piece(1, 3); + expect(element('.winner').text()).toEqual('Player X has won!'); + }); + + + function piece(row, col) { + element('.board tr:nth-child('+row+') td:nth-child('+col+')').click(); + } +
@@ -123,13 +125,12 @@ no connection between the controller and the view. * The controller is defined in JavaScript and has no reference to the rendering logic. * The controller is instantiated by and injected into the view. * The controller can be instantiated in isolation (without a view) and the code will still execute. - This makes it very testable. +This makes it very testable. * The HTML view is a projection of the model. In the above example, the model is stored in the - board variable. +board variable. * All of the controller's properties (such as board and nextMove) are available to the view. * Changing the model changes the view. * The view can call any controller function. * In this example, the `setUrl()` and `readUrl()` functions copy the game state to/from the URL's - hash so the browser's back button will undo game steps. See deep-linking. This example calls - {@link api/angular.scope.$watch $watch()} to set up a listener that invokes `readUrl()` when -needed. +hash so the browser's back button will undo game steps. See deep-linking. This example calls {@link +api/angular.scope.$watch $watch()} to set up a listener that invokes `readUrl()` when needed. diff --git a/docs/content/tutorial/step_04.ngdoc b/docs/content/tutorial/step_04.ngdoc index 7c942c34..39bb3d51 100644 --- a/docs/content/tutorial/step_04.ngdoc +++ b/docs/content/tutorial/step_04.ngdoc @@ -180,7 +180,7 @@ The unit test now verifies that the default ordering property is set. We used Jasmine's API to extract the controller construction into a `beforeEach` block, which is -shared by all tests in the nearest `describe` block. +shared by all tests in the parent `describe` block. To run the unit tests, once again execute the `./scripts/test.sh` script and you should see the @@ -205,7 +205,7 @@ __`test/e2e/scenarios.js`:__ function() { - // let's narrow the dataset to make the test assertions shorter + // narrow the dataset to make the test assertions shorter input('query').enter('tablet'); diff --git a/docs/content/tutorial/step_08.ngdoc b/docs/content/tutorial/step_08.ngdoc index c0ba2831..a430387b 100644 --- a/docs/content/tutorial/step_08.ngdoc +++ b/docs/content/tutorial/step_08.ngdoc @@ -111,7 +111,7 @@ our model into the view. __`app/partials/phone-details.html`:__
-
+
 
 
 

{{phone.name}}

diff --git a/docs/content/tutorial/step_10.ngdoc b/docs/content/tutorial/step_10.ngdoc index 3a8dbd38..109f5b77 100644 --- a/docs/content/tutorial/step_10.ngdoc +++ b/docs/content/tutorial/step_10.ngdoc @@ -42,7 +42,7 @@ function PhoneDetailCtrl($xhr) { $xhr('GET', 'phones/' + self.params.phoneId + '.json', function(code, response) { self.phone = response; - self.mainImageUrl = response.images; + self.mainImageUrl = response.images[0]; }); diff --git a/docs/content/tutorial/step_11.ngdoc b/docs/content/tutorial/step_11.ngdoc index 7a176591..892342b5 100644 --- a/docs/content/tutorial/step_11.ngdoc +++ b/docs/content/tutorial/step_11.ngdoc @@ -102,7 +102,7 @@ function PhoneDetailCtrl(Phone_) { self.phone = Phone_.get({phoneId: self.params.phoneId}, function(phone) { - self.mainImageUrl = phone.images; + self.mainImageUrl = phone.images[0]; }); -- cgit v1.2.3