@@ -105,17 +105,17 @@ dependencies of `MyController` without the controller ever knowing about the inj
105105the best outcome. The application code simply asks for the dependencies it needs, without having to
106106deal with the injector. This setup does not break the Law of Demeter.
107107
108- # Dependency Annotation
108+ ## Dependency Annotation
109109
110110How does the injector know what service needs to be injected?
111111
112112The application developer needs to provide annotation information that the injector uses in order
113- to resolve the dependencies. Throughout Angular certain API functions are invoked using the
113+ to resolve the dependencies. Throughout Angular, certain API functions are invoked using the
114114injector, as per the API documentation. The injector needs to know what services to inject into
115115the function. Below are three equivalent ways of annotating your code with service name
116116information. These can be used interchangeably as you see fit and are equivalent.
117117
118- # Inferring Dependencies
118+ ### Inferring Dependencies
119119
120120The simplest way to get hold of the dependencies, is to assume that the function parameter names
121121are the names of the dependencies.
@@ -134,7 +134,7 @@ While straightforward, this method will not work with JavaScript minifiers/obfus
134134rename the method parameter names. This makes this way of annotating only useful for {@link
135135http://www.pretotyping.org/ pretotyping}, and demo applications.
136136
137- # `$inject` Annotation
137+ ### `$inject` Annotation
138138
139139To allow the minifers to rename the function parameters and still be able to inject right services
140140the function needs to be annotated with the `$inject` property. The `$inject` property is an array
@@ -153,7 +153,7 @@ function declaration.
153153This method of annotation is useful for controller declarations since it assigns the annotation
154154information with the function.
155155
156- # Inline Annotation
156+ ### Inline Annotation
157157
158158Sometimes using the `$inject` annotation style is not convenient such as when annotating
159159directives.
@@ -189,11 +189,11 @@ For this reason the third annotation style is provided as well.
189189Keep in mind that all of the annotation styles are equivalent and can be used anywhere in Angular
190190where injection is supported.
191191
192- # Where can I use DI?
192+ ## Where can I use DI?
193193
194194DI is pervasive throughout Angular. It is typically used in controllers and factory methods.
195195
196- ## DI in controllers
196+ ### DI in controllers
197197
198198Controllers are classes which are responsible for application behavior. The recommended way of
199199declaring controllers is:
@@ -209,7 +209,7 @@ declaring controllers is:
209209</pre>
210210
211211
212- ## Factory methods
212+ ### Factory methods
213213
214214Factory methods are responsible for creating most objects in Angular. Examples are directives,
215215services, and filters. The factory methods are registered with the module, and the recommended way
0 commit comments