@@ -25,17 +25,19 @@ GitHub}:
25
25
__`app/js/controllers.js`:__
26
26
<pre>
27
27
...
28
- var phonecatApp = angular.module('phonecatApp',[]);
29
- phonecatApp.controller('PhoneDetailCtrl', ['$scope', '$routeParams', '$http', function($scope, $routeParams, $http) {
30
- $http.get('phones/' + $routeParams.phoneId + '.json').success(function(data) {
31
- $scope.phone = data;
32
- $scope.mainImageUrl = data.images[0];
33
- });
28
+ var phonecatControllers = angular.module('phonecatControllers',[]);
29
+
30
+ phonecatControllers.controller('PhoneDetailCtrl', ['$scope', '$routeParams', '$http',
31
+ function($scope, $routeParams, $http) {
32
+ $http.get('phones/' + $routeParams.phoneId + '.json').success(function(data) {
33
+ $scope.phone = data;
34
+ $scope.mainImageUrl = data.images[0];
35
+ });
34
36
35
- $scope.setImage = function(imageUrl) {
36
- $scope.mainImageUrl = imageUrl;
37
- }
38
- }]);
37
+ $scope.setImage = function(imageUrl) {
38
+ $scope.mainImageUrl = imageUrl;
39
+ }
40
+ }]);
39
41
</pre>
40
42
41
43
In the `PhoneDetailCtrl` controller, we created the `mainImageUrl` model property and set its
@@ -133,7 +135,7 @@ template remains operational.
133
135
134
136
# Summary
135
137
136
- With the phone image swapper in place, we're ready for {@link step_11 step 11} (the last step!) to
138
+ With the phone image swapper in place, we're ready for {@link step_11 step 11} to
137
139
learn an even better way to fetch data.
138
140
139
141
0 commit comments