Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0ab35c0

Browse files
committed
removed spaces from api file
1 parent 787cb70 commit 0ab35c0

File tree

1 file changed

+42
-42
lines changed

1 file changed

+42
-42
lines changed

public/docs/js/latest/api/di/Injector-class.jade

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,67 +5,67 @@ p.location-badge.
55

66
:markdown
77
A dependency injection container used for resolving dependencies.
8-
8+
99
An `Injector` is a replacement for a `new` operator, which can automatically resolve the constructor dependencies.
1010
In typical use, application code asks for the dependencies in the constructor and they are resolved by the
1111
`Injector`.
12-
12+
1313
## Example:
14-
14+
1515
Suppose that we want to inject an `Engine` into class `Car`, we would define it like this:
16-
16+
1717
```javascript
1818
class Engine {
1919
}
20-
20+
2121
class Car {
22-
constructor(@Inject(Engine) engine) {
23-
}
22+
constructor(@Inject(Engine) engine) {
23+
}
2424
}
25-
25+
2626
```
27-
27+
2828
Next we need to write the code that creates and instantiates the `Injector`. We then ask for the `root` object,
2929
`Car`, so that the `Injector` can recursively build all of that object's dependencies.
30-
30+
3131
```javascript
3232
main() {
3333
var injector = Injector.resolveAndCreate([Car, Engine]);
34-
34+
3535
// Get a reference to the `root` object, which will recursively instantiate the tree.
3636
var car = injector.get(Car);
3737
}
3838
```
3939
Notice that we don't use the `new` operator because we explicitly want to have the `Injector` resolve all of the
4040
object's dependencies automatically.
41-
41+
4242
.l-main-section
4343
h2 Members
4444
.l-sub-section
4545
h3 constructor
4646

47-
47+
4848
pre.prettyprint
4949
code.
5050
constructor(bindings:List<ResolvedBinding>, parent:Injector, defaultBindings:boolean, [object Object], [object Object], [object Object])
51-
51+
5252
:markdown
53-
53+
5454

5555

5656

5757

5858
.l-sub-section
5959
h3 asyncGet
6060

61-
61+
6262
pre.prettyprint
6363
code.
6464
asyncGet(token, [object Object])
65-
65+
6666
:markdown
6767
Retrieves an instance from the injector asynchronously. Used with asynchronous bindings.
68-
68+
6969

7070

7171

@@ -74,14 +74,14 @@ p.location-badge.
7474
.l-sub-section
7575
h3 createChildFromResolved
7676

77-
77+
7878
pre.prettyprint
7979
code.
8080
createChildFromResolved(bindings:List<ResolvedBinding>, [object Object])
81-
81+
8282
:markdown
8383
Creates a child injector and loads a new set of <a href="angular2/di/ResolvedBinding-class"><code>ResolvedBinding</code></a>s into it.
84-
84+
8585

8686

8787

@@ -90,15 +90,15 @@ p.location-badge.
9090
.l-sub-section
9191
h3 fromResolvedBindings
9292

93-
93+
9494
pre.prettyprint
9595
code.
9696
fromResolvedBindings(bindings:List&lt;ResolvedBinding&gt;, {defaultBindings=false}={}, [object Object], [object Object])
97-
97+
9898
:markdown
9999
Creates an injector from previously resolved bindings. This bypasses resolution and flattening. This API is the
100100
recommended way to construct injectors in performance-sensitive parts.
101-
101+
102102

103103

104104

@@ -107,14 +107,14 @@ p.location-badge.
107107
.l-sub-section
108108
h3 get
109109

110-
110+
111111
pre.prettyprint
112112
code.
113113
get(token, [object Object])
114-
114+
115115
:markdown
116116
Retrieves an instance from the injector.
117-
117+
118118

119119

120120

@@ -123,14 +123,14 @@ p.location-badge.
123123
.l-sub-section
124124
h3 getOptional
125125

126-
126+
127127
pre.prettyprint
128128
code.
129129
getOptional(token, [object Object])
130-
130+
131131
:markdown
132132
Retrieves an instance from the injector.
133-
133+
134134

135135

136136

@@ -139,18 +139,18 @@ p.location-badge.
139139
.l-sub-section
140140
h3 resolve
141141

142-
142+
143143
pre.prettyprint
144144
code.
145145
resolve(bindings:List, [object Object])
146-
146+
147147
:markdown
148148
Turns a list of binding definitions into an internal resolved list of resolved bindings.
149-
149+
150150
A resolution is a process of flattening multiple nested lists and converting individual bindings into a
151151
list of <a href="angular2/di/ResolvedBinding-class"><code>ResolvedBinding</code></a>s. The resolution can be cached by `resolve` for the <a href="angular2/di/Injector-class"><code>Injector</code></a> for
152152
performance-sensitive code.
153-
153+
154154

155155

156156

@@ -159,18 +159,18 @@ p.location-badge.
159159
.l-sub-section
160160
h3 resolveAndCreate
161161

162-
162+
163163
pre.prettyprint
164164
code.
165165
resolveAndCreate(bindings:List, {defaultBindings=false}={}, [object Object], [object Object])
166-
166+
167167
:markdown
168168
Resolves bindings and creates an injector based on those bindings. This function is slower than the
169169
corresponding `fromResolvedBindings` because it needs to resolve bindings first. See `resolve` for the
170170
<a href="angular2/di/Injector-class"><code>Injector</code></a>.
171-
171+
172172
Prefer `fromResolvedBindings` in performance-critical code that creates lots of injectors.
173-
173+
174174

175175

176176

@@ -179,18 +179,18 @@ p.location-badge.
179179
.l-sub-section
180180
h3 resolveAndCreateChild
181181

182-
182+
183183
pre.prettyprint
184184
code.
185185
resolveAndCreateChild(bindings:List, [object Object])
186-
186+
187187
:markdown
188188
Creates a child injector and loads a new set of bindings into it.
189-
189+
190190
A resolution is a process of flattening multiple nested lists and converting individual bindings into a
191191
list of <a href="angular2/di/ResolvedBinding-class"><code>ResolvedBinding</code></a>s. The resolution can be cached by `resolve` for the <a href="angular2/di/Injector-class"><code>Injector</code></a> for
192192
performance-sensitive code.
193-
193+
194194

195195

196196

0 commit comments

Comments
 (0)