aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content/tutorial/step_10.ngdoc
diff options
context:
space:
mode:
authorJames Dunn2013-10-03 10:16:44 +0100
committerPete Bacon Darwin2013-10-03 10:19:19 +0100
commit575f63ac508a988e0c0ecbf93f62ea6f4bab13c0 (patch)
treebd3fdf07e1b4d0e98a926b9f3ba25f3d4ab81bcd /docs/content/tutorial/step_10.ngdoc
parentd3fcacedd6e6fe14892fa110ebe20babd886d4bb (diff)
downloadangular.js-575f63ac508a988e0c0ecbf93f62ea6f4bab13c0.tar.bz2
docs(tutorial): update examples to show best practices
Closes #4256, #4255, #4254, #4253, #4250, #4092
Diffstat (limited to 'docs/content/tutorial/step_10.ngdoc')
-rw-r--r--docs/content/tutorial/step_10.ngdoc7
1 files changed, 3 insertions, 4 deletions
diff --git a/docs/content/tutorial/step_10.ngdoc b/docs/content/tutorial/step_10.ngdoc
index 632089cb..b612d996 100644
--- a/docs/content/tutorial/step_10.ngdoc
+++ b/docs/content/tutorial/step_10.ngdoc
@@ -25,7 +25,8 @@ GitHub}:
__`app/js/controllers.js`:__
<pre>
...
-function PhoneDetailCtrl($scope, $routeParams, $http) {
+var myApp = angular.module('myApp',[]);
+myApp.controller('PhoneDetailCtrl', ['$scope', '$routeParams', '$http', function($scope, $routeParams, $http) {
$http.get('phones/' + $routeParams.phoneId + '.json').success(function(data) {
$scope.phone = data;
$scope.mainImageUrl = data.images[0];
@@ -34,9 +35,7 @@ function PhoneDetailCtrl($scope, $routeParams, $http) {
$scope.setImage = function(imageUrl) {
$scope.mainImageUrl = imageUrl;
}
-}
-
-//PhoneDetailCtrl.$inject = ['$scope', '$routeParams', '$http'];
+}]);
</pre>
In the `PhoneDetailCtrl` controller, we created the `mainImageUrl` model property and set its