Skip to content

Initialize the lifecycle state with initial state in window. #137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions docs/content/guide/di.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,20 @@ construction and lookup of dependencies.

Here is an example of using the injector service:

First create an AngularJS module that will hold the service definition. (The empty array passed as
the second parameter means that this module does not depend on any other modules.)

```js
// Provide the wiring information in a module
// Create a module to hold the service definition
var myModule = angular.module('myModule', []);
```

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

```js
// Define the `greeter` service
myModule.factory('greeter', function($window) {
return {
greet: function(text) {
Expand Down