From b76ed0b28cf77a46e8b0e76bf365462adc21d9b2 Mon Sep 17 00:00:00 2001 From: royling Date: Mon, 14 Oct 2013 11:13:39 +0800 Subject: docs(tutorial/step-5): add missing formatting to examples The indenting doesn't work for code samples that are inside bullet points. Closes #4403 --- docs/content/tutorial/step_05.ngdoc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'docs/content/tutorial/step_05.ngdoc') diff --git a/docs/content/tutorial/step_05.ngdoc b/docs/content/tutorial/step_05.ngdoc index 214535e0..4e927728 100644 --- a/docs/content/tutorial/step_05.ngdoc +++ b/docs/content/tutorial/step_05.ngdoc @@ -117,25 +117,25 @@ There are two ways to overcome issues caused by minification: * You can create a `$inject` property on the controller function which holds an array of strings. Each string in the array is the name of the service to inject for the corresponding parameter. In the case of our example we would write: - +
function PhoneListCtrl($scope, $http) {...}
PhoneListCtrl.$inject = ['$scope', '$http'];
phonecatApp.controller('PhoneListCtrl', PhoneListCtrl);
-
+
* Use the inline bracket notation which wraps the function to be injected into an array of strings
(representing the dependency names) followed by the function to be injected:
-
+
function PhoneListCtrl($scope, $http) {...}
phonecatApp.controller('PhoneListCtrl', ['$scope', '$http', PhoneListCtrl]);
-
+
Both of these methods work with any function that can be injected by Angular, so it's up to your
project's style guide to decide which one you use.
When using the second method, it is common to provide the constructor function inline as an
anonymous function when registering the controller:
-
+
phonecatApp.controller('PhoneListCtrl', ['$scope', '$http', function($scope, $http) {...}]);
-
+
From this point onward, we're going to use the inline method in the tutorial. With that in mind,
let's add the annotations to our `PhoneListCtrl`:
--
cgit v1.2.3