@@ -50,16 +50,16 @@ var _EMPTY_LIST = []; // TODO: make const when supported
5050export class Binding {
5151
5252 /**
53- * Token used when retriving this binding. Usually the [Type].
53+ * Token used when retrieving this binding. Usually the [Type].
5454 */
5555 token ;
5656
5757 /**
58- * Bind an interface to an implementation / subclass.
58+ * Binds an interface to an implementation / subclass.
5959 *
6060 * ## Example
6161 *
62- * Becuse `toAlias` and `toClass` are often confused the example contains both use cases for easy comparison.
62+ * Becuse `toAlias` and `toClass` are often confused, the example contains both use cases for easy comparison.
6363 *
6464 * ```javascript
6565 *
@@ -86,7 +86,7 @@ export class Binding {
8686 toClass :Type ;
8787
8888 /**
89- * Bind a key to a value.
89+ * Binds a key to a value.
9090 *
9191 * ## Example
9292 *
@@ -101,10 +101,10 @@ export class Binding {
101101 toValue ;
102102
103103 /**
104- * Bind a key to an alias of an existing key.
104+ * Binds a key to the alias for an existing key.
105105 *
106- * An alias means that we will return the same instance as if the alias token was used. ( This is in contrast to
107- * `toClass` where a separet instance of `toClass` will be returned.)
106+ * An alias means that [Injector] returns the same instance as if the alias token was used. This is in contrast to
107+ * `toClass` where a separate instance of `toClass` is returned.
108108 *
109109 * ## Example
110110 *
@@ -127,15 +127,15 @@ export class Binding {
127127 *
128128 * expect(injectorAlias.get(Vehicle)).toBe(injectorAlias.get(Car));
129129 * expect(injectorAlias.get(Vehicle) instanceof Car).toBe(true);
130-
130+ *
131131 * expect(injectorClass.get(Vehicle)).not.toBe(injectorClass.get(Car));
132132 * expect(injectorClass.get(Vehicle) instanceof Car).toBe(true);
133133 * ```
134134 */
135135 toAlias ;
136136
137137 /**
138- * Bind a key to a function which computes the value.
138+ * Binds a key to a function which computes the value.
139139 *
140140 * ## Example
141141 *
@@ -153,7 +153,7 @@ export class Binding {
153153 toFactory :Function ;
154154
155155 /**
156- * Bind a key to a function which computes the value asynchronously.
156+ * Binds a key to a function which computes the value asynchronously.
157157 *
158158 * ## Example
159159 *
@@ -170,15 +170,17 @@ export class Binding {
170170 * injector.asyncGet(String).then((v) => expect(v).toBe('Value: 3'));
171171 * ```
172172 *
173- * The interesting thing to note is that event thougt `Numeber` has an async factory, the `String` factory
174- * function takes the resolved value. This shows that the [Injector] delays executing of the `String` factory
175- * until after the `Number` is resolved. This can only be done if the `token` is retrive
173+ * The interesting thing to note is that event though `Number` has an async factory, the `String` factory
174+ * function takes the resolved value. This shows that the [Injector] delays executing the `String` factory
175+ * until after the `Number` is resolved. This can only be done if the `token` is retrieved using the
176+ * [Injector.asyncGet] API.
177+ *
176178 */
177179 toAsyncFactory :Function ;
178180
179181 /**
180- * Used in conjunction with `toFactory` or `toAsyncFactory` and specifies the `token`s which should be injected
181- * into the factory function.
182+ * Used in conjunction with `toFactory` or `toAsyncFactory` and specifies a set of dependencies (as `token`s) which
183+ * should be injected into the factory function.
182184 *
183185 * ## Example
184186 *
@@ -216,7 +218,9 @@ export class Binding {
216218 }
217219
218220 /**
219- *
221+ * Converts the [Binding] into [ResolvedBinding].
222+ *
223+ * [Injector] internaly only uses [ResolvedBindings], [Binding] contains convenience sugar.
220224 */
221225 resolve ( ) : ResolvedBinding {
222226 var factoryFn :Function ;
@@ -250,29 +254,31 @@ export class Binding {
250254}
251255
252256/**
253- * An internal resolved representaion of a [Binding] used by [Injector].
254- *
255- * A [Binding] is resolved when it has a factory fonction. Binding to a class, alias, or value, are just convenience
256- * methods, as [Injector] only operates on calling factory functions.
257+ * An internal resolved representation of a [Binding] used by the [Injector].
258+ *
259+ * A [Binding] is resolved when it has a factory function. Binding to a class, alias, or value, are just convenience
260+ * methods, as [Injector] only operates on calling factory functions.
261+ *
262+ * @exportedAs angular2/di
257263 */
258264export class ResolvedBinding {
259265 /**
260266 * A key, usually a [Type].
261267 */
262268 key :Key ;
263-
269+
264270 /**
265- * Factory function which can return an instance of [key].
271+ * Factory function which can return an instance of represented by a [key].
266272 */
267273 factory :Function ;
268-
274+
269275 /**
270276 * Arguments (dependencies) to the [factory] function.
271277 */
272278 dependencies :List < Dependency > ;
273-
279+
274280 /**
275- * Specifies if the [factory] function returns an [Promise]
281+ * Specifies whether the [factory] function returns a [Promise].
276282 */
277283 providedAsPromise :boolean ;
278284
@@ -285,7 +291,9 @@ export class ResolvedBinding {
285291}
286292
287293/**
288- * Provides fluent API for imperative construction of [Binding] objects. (JavaScript only.)
294+ * Provides an API for imperatively constructing [Binding]s.
295+ *
296+ * This is only relevant for JavaScript.
289297 *
290298 * @exportedAs angular2/di
291299 */
@@ -294,7 +302,8 @@ export function bind(token):BindingBuilder {
294302}
295303
296304/**
297- * Helper class for [bind] function.
305+ * Helper class for the [bind] function.
306+ *
298307 * @exportedAs angular2/di
299308 */
300309export class BindingBuilder {
@@ -305,11 +314,11 @@ export class BindingBuilder {
305314 }
306315
307316 /**
308- * Bind an interface to an implementation / subclass.
317+ * Binds an interface to an implementation / subclass.
309318 *
310319 * ## Example
311320 *
312- * Becuse `toAlias` and `toClass` are often confused the example contains both use cases for easy comparison.
321+ * Because `toAlias` and `toClass` are often confused, the example contains both use cases for easy comparison.
313322 *
314323 * ```javascript
315324 *
@@ -338,7 +347,7 @@ export class BindingBuilder {
338347 }
339348
340349 /**
341- * Bind a key to a value.
350+ * Binds a key to a value.
342351 *
343352 * ## Example
344353 *
@@ -355,14 +364,14 @@ export class BindingBuilder {
355364 }
356365
357366 /**
358- * Bind a key to an alias of an existing key.
367+ * Binds a key to the alias for an existing key.
359368 *
360369 * An alias means that we will return the same instance as if the alias token was used. (This is in contrast to
361370 * `toClass` where a separet instance of `toClass` will be returned.)
362371 *
363372 * ## Example
364373 *
365- * Becuse `toAlias` and `toClass` are often confused the example contains both use cases for easy comparison.
374+ * Becuse `toAlias` and `toClass` are often confused, the example contains both use cases for easy comparison.
366375 *
367376 * ```javascript
368377 *
@@ -381,7 +390,7 @@ export class BindingBuilder {
381390 *
382391 * expect(injectorAlias.get(Vehicle)).toBe(injectorAlias.get(Car));
383392 * expect(injectorAlias.get(Vehicle) instanceof Car).toBe(true);
384-
393+ *
385394 * expect(injectorClass.get(Vehicle)).not.toBe(injectorClass.get(Car));
386395 * expect(injectorClass.get(Vehicle) instanceof Car).toBe(true);
387396 * ```
@@ -391,7 +400,7 @@ export class BindingBuilder {
391400 }
392401
393402 /**
394- * Bind a key to a function which computes the value.
403+ * Binds a key to a function which computes the value.
395404 *
396405 * ## Example
397406 *
@@ -413,7 +422,7 @@ export class BindingBuilder {
413422 }
414423
415424 /**
416- * Bind a key to a function which computes the value asynchronously.
425+ * Binds a key to a function which computes the value asynchronously.
417426 *
418427 * ## Example
419428 *
@@ -429,9 +438,10 @@ export class BindingBuilder {
429438 * injector.asyncGet(String).then((v) => expect(v).toBe('Value: 3'));
430439 * ```
431440 *
432- * The interesting thing to note is that event thougt `Numeber ` has an async factory, the `String` factory
441+ * The interesting thing to note is that event though `Number ` has an async factory, the `String` factory
433442 * function takes the resolved value. This shows that the [Injector] delays executing of the `String` factory
434- * until after the `Number` is resolved. This can only be done if the `token` is retrive
443+ * until after the `Number` is resolved. This can only be done if the `token` is retrieved using the
444+ * [Injector.asyncGet] API.
435445 */
436446 toAsyncFactory ( factoryFunction :Function , dependencies :List = null ) :Binding {
437447 return new Binding ( this . token , {
0 commit comments