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

Commit edb3e22

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

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy