From e205bd7137fd793d223dbe3e020a628f8e7d98f3 Mon Sep 17 00:00:00 2001 From: Kenneth R. Culp Date: Fri, 29 Apr 2011 10:04:40 -0700 Subject: Update tutorial docs. --- docs/tutorial.step_10.ngdoc | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'docs/tutorial.step_10.ngdoc') diff --git a/docs/tutorial.step_10.ngdoc b/docs/tutorial.step_10.ngdoc index a993bee1..2abe3344 100644 --- a/docs/tutorial.step_10.ngdoc +++ b/docs/tutorial.step_10.ngdoc @@ -5,20 +5,20 @@ - + - +
{@link tutorial.step_9 Previous}{@link http://angular.github.com/angular-phonecat/step-10/app Example}{@link http://angular.github.com/angular-phonecat/step-10/app Live Demo +} {@link tutorial Tutorial Home}{@link -https://github.com/angular/angular-phonecat/commit/abe1e13c7d9e725fdd3b811ca5ec28ea0d973aab Code -Diff}{@link https://github.com/angular/angular-phonecat/compare/step-9...step-10 +Code Diff} {@link tutorial.step_11 Next}
-In this step we will add a phone image swapping feature. We want to be able to click on a -thumbnail image in the phone details page, and have that action change the large phone image to -match the selection. +The phone details view displays one large image of the current phone and several smaller thumbnail +images. It would be great if we could replace the large image with any of the thumbnails just by +clicking on the desired thumbnail image. Let's have a look how we can do this with angular. -__`app/partials/phone-detail.html`.__ +__`app/partials/phone-detail.html`:__
 
 
@@ -34,7 +34,7 @@ __`app/partials/phone-detail.html`.__
 ...
 
-__`app/js/controllers.js`.__ +__`app/js/controllers.js`:__
 ...
 function PhoneDetailCtrl($xhr) {
@@ -53,7 +53,7 @@ function PhoneDetailCtrl($xhr) {
 //PhoneDetailCtrl.$inject = ['$xhr'];
 
-__`test/e2e/scenarios.js`.__ +__`test/e2e/scenarios.js`:__
 /* jasmine-like end2end tests go here */
 ...
@@ -68,7 +68,7 @@ __`test/e2e/scenarios.js`.__
       expect(binding('phone.name')).toBe('Nexus S');
     });
 
-    it('should display "0.large" image as the main phone image', function() {
+    it('should display the first phone image as the main phone image', function() {
        expect(element('img.phone').attr('src')).toBe('img/phones/nexus-s.0.jpg');
     });
 
@@ -88,22 +88,23 @@ __`test/e2e/scenarios.js`.__
 
 Adding the phone image swapping feature is fairly straightforward:
 
-- We defined the `mainImageUrl` model variable in the details controller (`PhoneDetailCtrl`) and
+* We defined the `mainImageUrl` model property in the details controller (`PhoneDetailCtrl`) and
 set the default value of `mainImageUrl` to the first image in the array of images.
-- We created a `setImage` controller method to change `mainImageUrl` to the image clicked on by
+* We created a `setImage` controller method to change `mainImageUrl` to the image clicked on by
 the user.
-- We registered an `ng:click` handler for thumb images to use the `setImage` controller method.
-- And of course, we added e2e tests for our new feature.
+* We registered an `{@link angular.directive.ng:click ng:click}` handler for thumb images to use
+the `setImage` controller method.
+* We expanded the end-to-end test to verify that our new feature is swapping images correctly.
 
 
 
-
+
-
+
{@link tutorial.step_9 Previous}{@link http://angular.github.com/angular-phonecat/step-10/app Example}{@link http://angular.github.com/angular-phonecat/step-10/app Live Demo +} {@link tutorial Tutorial Home}{@link -https://github.com/angular/angular-phonecat/commit/abe1e13c7d9e725fdd3b811ca5ec28ea0d973aab Code -Diff}{@link https://github.com/angular/angular-phonecat/compare/step-9...step-10 +Code Diff} {@link tutorial.step_11 Next}
-- cgit v1.2.3