feat(di): Add the @Injectable
annotation
Add an annotation marking a class as available to `Injector`s.
This commit is contained in:
21
modules/angular2/src/di/annotations.js
vendored
21
modules/angular2/src/di/annotations.js
vendored
@ -107,4 +107,23 @@ export class DependencyAnnotation {
|
||||
@CONST()
|
||||
constructor() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A class annotation that marks a class as available to `Injector`s for
|
||||
* creation.
|
||||
*
|
||||
* ```
|
||||
* class NeedsService {
|
||||
* constructor(svc:UsefulService) {}
|
||||
* }
|
||||
*
|
||||
* @Injectable
|
||||
* class UsefulService {}
|
||||
* ```
|
||||
*/
|
||||
export class Injectable {
|
||||
@CONST()
|
||||
constructor() {
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user