diff options
| author | Brian Ford | 2013-10-08 10:45:00 -0700 |
|---|---|---|
| committer | Brian Ford | 2013-10-08 10:49:33 -0700 |
| commit | 556e8eece69b93b89c6ae1cc4cb86d08994a0dfc (patch) | |
| tree | e797331ff844daf220327f43a0ad5a0a0bbe64f0 /docs/content/tutorial/step_02.ngdoc | |
| parent | d769b8b8f0fba81b35e441249e31e7e209d40580 (diff) | |
| download | angular.js-556e8eece69b93b89c6ae1cc4cb86d08994a0dfc.tar.bz2 | |
docs(tutorial): fix style across tutorial steps
Diffstat (limited to 'docs/content/tutorial/step_02.ngdoc')
| -rw-r--r-- | docs/content/tutorial/step_02.ngdoc | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/docs/content/tutorial/step_02.ngdoc b/docs/content/tutorial/step_02.ngdoc index 16dbe366..539c541b 100644 --- a/docs/content/tutorial/step_02.ngdoc +++ b/docs/content/tutorial/step_02.ngdoc @@ -79,28 +79,27 @@ the `PhoneListCtrl` __controller__. The __controller__ is simply a constructor f __`app/js/controllers.js`:__ <pre> -function PhoneListCtrl($scope) { +var phonecatApp = angular.module('phonecatApp', []); + +phonecatApp.controller('PhoneListCtrl', function PhoneListCtrl($scope) { $scope.phones = [ - {"name": "Nexus S", - "snippet": "Fast just got faster with Nexus S."}, - {"name": "Motorola XOOM™ with Wi-Fi", - "snippet": "The Next, Next Generation tablet."}, - {"name": "MOTOROLA XOOM™", - "snippet": "The Next, Next Generation tablet."} + {'name': 'Nexus S', + 'snippet': 'Fast just got faster with Nexus S.'}, + {'name': 'Motorola XOOM™ with Wi-Fi', + 'snippet': 'The Next, Next Generation tablet.'}, + {'name': 'MOTOROLA XOOM™', + 'snippet': 'The Next, Next Generation tablet.'} ]; -} - -var phonecatApp = angular.module('phonecatApp',[]); -phonecatApp.controller('PhoneListCtrl', PhoneListCtrl); +}); </pre> -Here we have declared a controller called __PhoneListCtrl__ and registered it in an AngularJS +Here we declared a controller called __PhoneListCtrl__ and registered it in an AngularJS module, `phonecatApp`. Notice that our `ng-app` directive (on the `<html>` tag) now specifies the `phonecatApp` module name as the module to load when bootstrapping the Angular application. -Although the controller is not yet doing very much controlling, it is playing a crucial role. By -providing context for our data model, the controller allows us to establish data-binding between +Although the controller is not yet doing very much, it plays a crucial role. By providing context +for our data model, the controller allows us to establish data-binding between the model and the view. We connected the dots between the presentation, data, and logic components as follows: |
