@@ -5,10 +5,11 @@ import {CONST} from "angular2/src/facade/lang";
55 *
66 * ```
77 * class AComponent {
8- * constructor(@Inject ('aServiceToken' ) aService) {}
8+ * constructor(@Inject (MyService ) aService:MyService ) {}
99 * }
1010 * ```
1111 *
12+ * @exportedAs angular2/di_annotations
1213 */
1314export class Inject {
1415 token ;
@@ -23,12 +24,13 @@ export class Inject {
2324 *
2425 * ```
2526 * class AComponent {
26- * constructor(@InjectPromise ('aServiceToken' ) aServicePromise) {
27- * aServicePromise.then(aService => ...);
27+ * constructor(@InjectPromise (MyService ) aServicePromise:Promise<MyService> ) {
28+ * aServicePromise.then(aService:MyService => ...);
2829 * }
2930 * }
3031 * ```
3132 *
33+ * @exportedAs angular2/di_annotations
3234 */
3335export class InjectPromise {
3436 token ;
@@ -43,12 +45,13 @@ export class InjectPromise {
4345 *
4446 * ```
4547 * class AComponent {
46- * constructor(@InjectLazy ('aServiceToken' ) aServiceFn) {
47- * aService = aServiceFn();
48+ * constructor(@InjectLazy (MyService ) aServiceFn:Function ) {
49+ * var aService:MyService = aServiceFn();
4850 * }
4951 * }
5052 * ```
5153 *
54+ * @exportedAs angular2/di_annotations
5255 */
5356export class InjectLazy {
5457 token ;
@@ -59,16 +62,16 @@ export class InjectLazy {
5962}
6063
6164/**
62- * A parameter annotation that marks a dependency as optional.
63- *
65+ * A parameter annotation that marks a dependency as optional. (Injects `null` if not found.)
6466 * ```
6567 * class AComponent {
66- * constructor(@Optional () dp:Dependency ) {
67- * this.dp = dp ;
68+ * constructor(@Optional () aService:MyService ) {
69+ * this.aService = aService ;
6870 * }
6971 * }
7072 * ```
7173 *
74+ * @exportedAs angular2/di_annotations
7275 */
7376export class Optional {
7477 @CONST ( )
@@ -102,6 +105,7 @@ export class Optional {
102105 * The framework can use `new Parent()` to handle the `aService` dependency
103106 * in a specific way.
104107 *
108+ * @exportedAs angular2/di_annotations
105109 */
106110export class DependencyAnnotation {
107111 @CONST ( )
@@ -114,8 +118,8 @@ export class DependencyAnnotation {
114118}
115119
116120/**
117- * A class annotation that marks a class as available to `Injector`s for
118- * creation.
121+ * A marker annotation that marks a class as available to `Injector`s for creation. Used by tooling for generating
122+ * constructor stubs.
119123 *
120124 * ```
121125 * class NeedsService {
@@ -125,6 +129,7 @@ export class DependencyAnnotation {
125129 * @Injectable
126130 * class UsefulService {}
127131 * ```
132+ * @exportedAs angular2/di_annotations
128133 */
129134export class Injectable {
130135 @CONST ( )
0 commit comments