Skip to content

Commit 059f852

Browse files
Update initializers.md
1 parent 9cb7419 commit 059f852

File tree

1 file changed

+0
-41
lines changed

1 file changed

+0
-41
lines changed

guides/release/applications/initializers.md

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -18,47 +18,6 @@ Any asynchronous loading conditions (e.g. user authorization) are almost always
1818
better handled in your application route's hooks,
1919
which allows for DOM interaction while waiting for conditions to resolve.
2020

21-
## Application Initializers
22-
23-
Application initializers can be created with Ember CLI's `initializer` generator:
24-
25-
```bash
26-
ember generate initializer shopping-cart
27-
```
28-
29-
Let's customize the `shopping-cart` initializer to inject a `cart` property into all the routes in your application:
30-
31-
```javascript {data-filename=app/initializers/shopping-cart.js}
32-
export function initialize(application) {
33-
application.inject('route', 'cart', 'service:shopping-cart');
34-
};
35-
36-
export default {
37-
initialize
38-
};
39-
```
40-
41-
## Application Instance Initializers
42-
43-
Application instance initializers can be created with Ember CLI's `instance-initializer` generator:
44-
45-
```bash
46-
ember generate instance-initializer logger
47-
```
48-
49-
Let's add some simple logging to indicate that the instance has booted:
50-
51-
```javascript {data-filename=app/instance-initializers/logger.js}
52-
export function initialize(applicationInstance) {
53-
let logger = applicationInstance.lookup('logger:main');
54-
logger.log('Hello from the instance initializer!');
55-
}
56-
57-
export default {
58-
initialize
59-
};
60-
```
61-
6221
## Specifying Initializer Order
6322

6423
If you'd like to control the order in which initializers run, you can use the `before` and/or `after` options:

0 commit comments

Comments
 (0)