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

Commit a1d1564

Browse files
kambleaa007gkalpak
authored andcommitted
docs(guide/di): clarify example description
Closes #16833
1 parent cbf35f0 commit a1d1564

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

docs/content/guide/di.ngdoc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,15 +279,20 @@ construction and lookup of dependencies.
279279

280280
Here is an example of using the injector service:
281281

282+
First create an AngularJS module that will hold the service definition. (The empty array passed as
283+
the second parameter means that this module does not depend on any other modules.)
284+
282285
```js
283-
// Provide the wiring information in a module
286+
// Create a module to hold the service definition
284287
var myModule = angular.module('myModule', []);
285288
```
286289

287-
Teach the injector how to build a `greeter` service. Notice that `greeter` is dependent on the
288-
`$window` service. The `greeter` service is an object that contains a `greet` method.
290+
Teach the injector how to build a `greeter` service, which is just an object that contains a `greet`
291+
method. Notice that `greeter` is dependent on the `$window` service, which will be provided
292+
(injected into `greeter`) by the injector.
289293

290294
```js
295+
// Define the `greeter` service
291296
myModule.factory('greeter', function($window) {
292297
return {
293298
greet: function(text) {

0 commit comments

Comments
 (0)