diff options
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 | 
