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_07.ngdoc | |
| parent | d769b8b8f0fba81b35e441249e31e7e209d40580 (diff) | |
| download | angular.js-556e8eece69b93b89c6ae1cc4cb86d08994a0dfc.tar.bz2 | |
docs(tutorial): fix style across tutorial steps
Diffstat (limited to 'docs/content/tutorial/step_07.ngdoc')
| -rw-r--r-- | docs/content/tutorial/step_07.ngdoc | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/docs/content/tutorial/step_07.ngdoc b/docs/content/tutorial/step_07.ngdoc index 76074417..126b30a8 100644 --- a/docs/content/tutorial/step_07.ngdoc +++ b/docs/content/tutorial/step_07.ngdoc @@ -69,13 +69,23 @@ both module systems can live side by side and fulfil their goals. __`app/js/app.js`:__ <pre> -var phonecatApp = angular.module('phonecatApp', []). - config(['$routeProvider', function($routeProvider) { - $routeProvider. - when('/phones', {templateUrl: 'partials/phone-list.html', controller: PhoneListCtrl}). - when('/phones/:phoneId', {templateUrl: 'partials/phone-detail.html', controller: PhoneDetailCtrl}). - otherwise({redirectTo: '/phones'}); -}]); +var phonecatApp = angular.module('phonecatApp', ['phonecatFilters']); + +phonecatApp.config(['$routeProvider', + function($routeProvider) { + $routeProvider. + when('/phones', { + templateUrl: 'partials/phone-list.html', + controller: 'PhoneListCtrl' + }). + when('/phones/:phoneId', { + templateUrl: 'partials/phone-detail.html', + controller: 'PhoneDetailCtrl' + }). + otherwise({ + redirectTo: '/phones' + }); + }]); </pre> In order to configure our application with routes, we need to create a module for our application. @@ -124,9 +134,10 @@ __`app/index.html`:__ __`app/js/controllers.js`:__ <pre> ... -phonecatApp.controller('PhoneDetailCtrl', ['$scope', '$routeParams', function($scope, $routeParams) { - $scope.phoneId = $routeParams.phoneId; -}]); +phonecatApp.controller('PhoneDetailCtrl', ['$scope', '$routeParams', + function($scope, $routeParams) { + $scope.phoneId = $routeParams.phoneId; + }]); </pre> @@ -251,6 +262,7 @@ the same binding into the `phone-list.html` template, the binding will work as e inheritance and model property shadowing do some wonders. </div> + # Summary With the routing set up and the phone list view implemented, we're ready to go to {@link step_08 |
