From 575f63ac508a988e0c0ecbf93f62ea6f4bab13c0 Mon Sep 17 00:00:00 2001 From: James Dunn Date: Thu, 3 Oct 2013 10:16:44 +0100 Subject: docs(tutorial): update examples to show best practices Closes #4256, #4255, #4254, #4253, #4250, #4092 --- docs/content/tutorial/step_07.ngdoc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'docs/content/tutorial/step_07.ngdoc') diff --git a/docs/content/tutorial/step_07.ngdoc b/docs/content/tutorial/step_07.ngdoc index ea46f5ef..35f1f920 100644 --- a/docs/content/tutorial/step_07.ngdoc +++ b/docs/content/tutorial/step_07.ngdoc @@ -69,7 +69,7 @@ both module systems can live side by side and fulfil their goals. __`app/js/app.js`:__
-angular.module('phonecat', []).
+var myApp = angular.module('phonecat', []).
config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/phones', {templateUrl: 'partials/phone-list.html', controller: PhoneListCtrl}).
@@ -124,11 +124,9 @@ __`app/index.html`:__
__`app/js/controllers.js`:__
...
-function PhoneDetailCtrl($scope, $routeParams) {
+myApp.controller('PhoneDetailCtrl', ['$scope', '$routeParams', function($scope, $routeParams) {
$scope.phoneId = $routeParams.phoneId;
-}
-
-//PhoneDetailCtrl.$inject = ['$scope', '$routeParams'];
+}]);
--
cgit v1.2.3