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

Commit cd3dd13

Browse files
Ore4444petebacondarwin
authored andcommitted
docs(guide/di): fix headings hierarchy
1 parent 45ee884 commit cd3dd13

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/content/guide/di.ngdoc

+8-8
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,17 @@ dependencies of `MyController` without the controller ever knowing about the inj
105105
the best outcome. The application code simply asks for the dependencies it needs, without having to
106106
deal with the injector. This setup does not break the Law of Demeter.
107107

108-
# Dependency Annotation
108+
## Dependency Annotation
109109

110110
How does the injector know what service needs to be injected?
111111

112112
The 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
114114
injector, as per the API documentation. The injector needs to know what services to inject into
115115
the function. Below are three equivalent ways of annotating your code with service name
116116
information. These can be used interchangeably as you see fit and are equivalent.
117117

118-
# Inferring Dependencies
118+
### Inferring Dependencies
119119

120120
The simplest way to get hold of the dependencies, is to assume that the function parameter names
121121
are the names of the dependencies.
@@ -134,7 +134,7 @@ While straightforward, this method will not work with JavaScript minifiers/obfus
134134
rename the method parameter names. This makes this way of annotating only useful for {@link
135135
http://www.pretotyping.org/ pretotyping}, and demo applications.
136136

137-
# `$inject` Annotation
137+
### `$inject` Annotation
138138

139139
To allow the minifers to rename the function parameters and still be able to inject right services
140140
the function needs to be annotated with the `$inject` property. The `$inject` property is an array
@@ -153,7 +153,7 @@ function declaration.
153153
This method of annotation is useful for controller declarations since it assigns the annotation
154154
information with the function.
155155

156-
# Inline Annotation
156+
### Inline Annotation
157157

158158
Sometimes using the `$inject` annotation style is not convenient such as when annotating
159159
directives.
@@ -189,11 +189,11 @@ For this reason the third annotation style is provided as well.
189189
Keep in mind that all of the annotation styles are equivalent and can be used anywhere in Angular
190190
where injection is supported.
191191

192-
# Where can I use DI?
192+
## Where can I use DI?
193193

194194
DI is pervasive throughout Angular. It is typically used in controllers and factory methods.
195195

196-
## DI in controllers
196+
### DI in controllers
197197

198198
Controllers are classes which are responsible for application behavior. The recommended way of
199199
declaring controllers is:
@@ -209,7 +209,7 @@ declaring controllers is:
209209
</pre>
210210

211211

212-
## Factory methods
212+
### Factory methods
213213

214214
Factory methods are responsible for creating most objects in Angular. Examples are directives,
215215
services, and filters. The factory methods are registered with the module, and the recommended way

0 commit comments

Comments
 (0)