feat(di): add support for optional dependencies

This commit is contained in:
vsavkin
2015-03-02 14:38:02 -08:00
committed by Misko Hevery
parent 23786aaa92
commit ba0a1ec459
7 changed files with 102 additions and 31 deletions
+18
View File
@@ -58,6 +58,24 @@ export class InjectLazy {
}
}
/**
* A parameter annotation that marks a dependency as optional.
*
* ```
* class AComponent {
* constructor(@Optional() dp:Dependency) {
* this.dp = dp;
* }
* }
* ```
*
*/
export class Optional {
@CONST()
constructor() {
}
}
/**
* `DependencyAnnotation` is used by the framework to extend DI.
*