Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

docs(tutorial) Change ctrls to not have name twice in tutorial #4415

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/content/tutorial/step_02.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ __`app/js/controllers.js`:__

var phonecatApp = angular.module('phonecatApp', []);

phonecatApp.controller('PhoneListCtrl', function PhoneListCtrl($scope) {
phonecatApp.controller('PhoneListCtrl', function ($scope) {
$scope.phones = [
{'name': 'Nexus S',
'snippet': 'Fast just got faster with Nexus S.'},
Expand Down
2 changes: 1 addition & 1 deletion docs/content/tutorial/step_04.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ __`app/js/controllers.js`:__
<pre>
var phonecatApp = angular.module('phonecatApp', []);

phonecatApp.controller('PhoneListCtrl', function PhoneListCtrl($scope) {
phonecatApp.controller('PhoneListCtrl', function ($scope) {
$scope.phones = [
{'name': 'Nexus S',
'snippet': 'Fast just got faster with Nexus S.',
Expand Down
6 changes: 3 additions & 3 deletions docs/content/tutorial/step_05.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ __`app/js/controllers.js:`__
<pre>
var phonecatApp = angular.module('phonecatApp', []);

phonecatApp.controller('PhoneListCtrl', function PhoneListCtrl($scope, $http) {
phonecatApp.controller('PhoneListCtrl', function ($scope, $http) {
$http.get('phones/phones.json').success(function(data) {
$scope.phones = data;
});
Expand All @@ -79,7 +79,7 @@ json response and parsed it for us!
To use a service in angular, you simply declare the names of the dependencies you need as arguments
to the controller's constructor function, as follows:

function PhoneListCtrl($scope, $http) {...}
phonecatApp.controller('PhoneListCtrl', function ($scope, $http) {...}

Angular's dependency injector provides services to your controller when the controller is being
constructed. The dependency injector also takes care of creating any transitive dependencies the
Expand Down Expand Up @@ -145,7 +145,7 @@ __`app/js/controllers.js:`__
var phonecatApp = angular.module('phonecatApp', []);

phonecatApp.controller('PhoneListCtrl', ['$scope', '$http',
function PhoneListCtrl($scope, $http) {
function ($scope, $http) {
$http.get('phones/phones.json').success(function(data) {
$scope.phones = data;
});
Expand Down
2 changes: 1 addition & 1 deletion docs/content/tutorial/step_07.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ __`app/js/controllers.js`:__
var phonecatControllers = angular.module('phonecatControllers', []);

phonecatControllers.controller('PhoneListCtrl', ['$scope', '$http',
function PhoneListCtrl($scope, $http) {
function ($scope, $http) {
$http.get('phones/phones.json').success(function(data) {
$scope.phones = data;
});
Expand Down