docs(tutorial/step-11): add controller to correct object

This commit is contained in:
ahliddin
2014-02-15 22:22:15 +01:00
committed by Peter Bacon Darwin
parent 666137d635
commit 2407891ddf

View File

@@ -81,14 +81,16 @@ now to understand what the code in our controllers is doing.
__`app/js/controllers.js`.__
```js
var phonecatControllers = angular.module('phonecatControllers', []);
...
phonecatApp.controller('PhoneListCtrl', ['$scope', 'Phone', function($scope, Phone) {
phonecatControllers.controller('PhoneListCtrl', ['$scope', 'Phone', function($scope, Phone) {
$scope.phones = Phone.query();
$scope.orderProp = 'age';
}]);
phonecatApp.controller('PhoneDetailCtrl', ['$scope', '$routeParams', 'Phone', function($scope, $routeParams, Phone) {
phonecatControllers.controller('PhoneDetailCtrl', ['$scope', '$routeParams', 'Phone', function($scope, $routeParams, Phone) {
$scope.phone = Phone.get({phoneId: $routeParams.phoneId}, function(phone) {
$scope.mainImageUrl = phone.images[0];
});