diff options
Diffstat (limited to 'docs/content/tutorial/step_04.ngdoc')
| -rw-r--r-- | docs/content/tutorial/step_04.ngdoc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/docs/content/tutorial/step_04.ngdoc b/docs/content/tutorial/step_04.ngdoc index 612619a4..adf362b6 100644 --- a/docs/content/tutorial/step_04.ngdoc +++ b/docs/content/tutorial/step_04.ngdoc @@ -24,7 +24,8 @@ The most important differences between Steps 3 and 4 are listed below. You can s ## Template __`app/index.html`:__ -<pre> + +```html Search: <input ng-model="query"> Sort by: <select ng-model="orderProp"> @@ -39,7 +40,7 @@ __`app/index.html`:__ <p>{{phone.snippet}}</p> </li> </ul> -</pre> +``` We made the following changes to the `index.html` template: @@ -65,7 +66,8 @@ necessary! ## Controller __`app/js/controllers.js`:__ -<pre> + +```js var phonecatApp = angular.module('phonecatApp', []); phonecatApp.controller('PhoneListCtrl', function ($scope) { @@ -83,7 +85,7 @@ phonecatApp.controller('PhoneListCtrl', function ($scope) { $scope.orderProp = 'age'; }); -</pre> +``` * We modified the `phones` model - the array of phones - and added an `age` property to each phone record. This property is used to order phones by age. @@ -107,7 +109,8 @@ The changes we made should be verified with both a unit test and an end-to-end t the unit test first. __`test/unit/controllersSpec.js`:__ -<pre> + +```js describe('PhoneCat controllers', function() { describe('PhoneListCtrl', function(){ @@ -130,7 +133,7 @@ describe('PhoneCat controllers', function() { }); }); }); -</pre> +``` The unit test now verifies that the default ordering property is set. @@ -146,7 +149,8 @@ You should now see the following output in the Karma tab: Let's turn our attention to the end-to-end test. __`test/e2e/scenarios.js`:__ -<pre> + +```js ... it('should be possible to control phone order via the drop down select box', function() { @@ -164,7 +168,7 @@ __`test/e2e/scenarios.js`:__ "Motorola XOOM\u2122 with Wi-Fi"]); }); ... -</pre> +``` The end-to-end test verifies that the ordering mechanism of the select box is working correctly. |
