File tree Expand file tree Collapse file tree 1 file changed +0
-41
lines changed
guides/release/applications Expand file tree Collapse file tree 1 file changed +0
-41
lines changed Original file line number Diff line number Diff line change @@ -18,47 +18,6 @@ Any asynchronous loading conditions (e.g. user authorization) are almost always
18
18
better handled in your application route's hooks,
19
19
which allows for DOM interaction while waiting for conditions to resolve.
20
20
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
-
62
21
## Specifying Initializer Order
63
22
64
23
If you'd like to control the order in which initializers run, you can use the ` before ` and/or ` after ` options:
You can’t perform that action at this time.
0 commit comments