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,CAAC,CAAC;AADrD,AAAI,EAAA,aAuDG,SAAM,WAAS,CAGR,KAAI,CAAG;AACjB,KAAG,MAAM,EAAI,MAAI,CAAC;AACpB,AA5DsC,CAAA;AAAxC,AAAC,eAAc,YAAY,CAAC,AAAC,oBAAwD;AAArF,KAAK,eAAe,AAAC,2BACb,EAAC,GAAE,CAAG,UAAS,AAAD,CAAG;AAAC,cAwDvB,MAAI,AAAC,EAAC,EAxDwC;EAAC,CAAC,CAAC,CAAC;AADrD,AAAI,EAAA,WA6EG,SAAM,SAAO,CAEN,AAAD,CAAG,GACd,AAhFsC,CAAA;AAAxC,AAAC,eAAc,YAAY,CAAC,AAAC,kBAAwD;AAArF,KAAK,eAAe,AAAC,yBACb,EAAC,GAAE,CAAG,UAAS,AAAD,CAAG;AAAC,cA6EvB,MAAI,AAAC,EAAC,EA7EwC;EAAC,CAAC,CAAC,CAAC;AADrD,AAAI,EAAA,uBA8GG,SAAM,qBAAmB,CAElB,AAAD,CAAG,GACd,AAjHsC,CAAA;AAAxC,AAAC,eAAc,YAAY,CAAC,AAAC,wBAmH3B,GAAI,MAAI,EAAI;AACV,SAAO,KAAG,CAAC;EACb,MArHmF;AAArF,KAAK,eAAe,AAAC,qCACb,EAAC,GAAE,CAAG,UAAS,AAAD,CAAG;AAAC,cA8GvB,MAAI,AAAC,EAAC,EA9GwC;EAAC,CAAC,CAAC,CAAC;AADrD,AAAI,EAAA,aAsIG,SAAM,WAAS,CAER,AAAD,CAAG,GACd,AAzIsC,CAAA;AAAxC,AAAC,eAAc,YAAY,CAAC,AAAC,oBAAwD;AAArF,KAAK,eAAe,AAAC,2BACb,EAAC,GAAE,CAAG,UAAS,AAAD,CAAG;AAAC,cAsIvB,MAAI,AAAC,EAAC,EAtIwC;EAAC,CAAC,CAAC,CAAC;AA0IrD","file":"angular2/src/di/annotations.js","sourcesContent":["import {CONST} from \"angular2/src/facade/lang\";\n\n/**\n * A parameter annotation that specifies a dependency.\n *\n * ```\n * class AComponent {\n *   constructor(@Inject(MyService) aService:MyService) {}\n * }\n * ```\n *\n * @exportedAs angular2/di_annotations\n */\nexport class Inject {\n  token;\n  @CONST()\n  constructor(token) {\n    this.token = token;\n  }\n}\n\n/**\n * A parameter annotation that specifies a `Promise` of a dependency.\n *\n * ```\n * class AComponent {\n *   constructor(@InjectPromise(MyService) aServicePromise:Promise<MyService>) {\n *     aServicePromise.then(aService:MyService => ...);\n *   }\n * }\n * ```\n *\n * @exportedAs angular2/di_annotations\n */\nexport class InjectPromise {\n  token;\n  @CONST()\n  constructor(token) {\n    this.token = token;\n  }\n}\n\n/**\n * A parameter annotation that creates a synchronous lazy dependency.\n *\n * ```\n * class AComponent {\n *   constructor(@InjectLazy(MyService) aServiceFn:Function) {\n *     var aService:MyService = aServiceFn();\n *   }\n * }\n * ```\n *\n * @exportedAs angular2/di_annotations\n */\nexport class InjectLazy {\n  token;\n  @CONST()\n  constructor(token) {\n    this.token = token;\n  }\n}\n\n/**\n * A parameter annotation that marks a dependency as optional. {@link Injector} provides `null` if the dependency is not\n * found.\n *\n * ```\n * class AComponent {\n *   constructor(@Optional() aService:MyService) {\n *     this.aService = aService;\n *   }\n * }\n * ```\n *\n * @exportedAs angular2/di_annotations\n */\nexport class Optional {\n  @CONST()\n  constructor() {\n  }\n}\n\n/**\n * `DependencyAnnotation` is used by the framework to extend DI.\n *\n * Only annotations implementing `DependencyAnnotation` are added to the list of dependency properties.\n *\n * For example:\n *\n * ```\n * class Parent extends DependencyAnnotation {}\n * class NotDependencyProperty {}\n *\n * class AComponent {\n *   constructor(@Parent @NotDependencyProperty aService:AService) {}\n * }\n * ```\n *\n * will create the following dependency:\n *\n * ```\n * new Dependency(Key.get(AService), [new Parent()])\n * ```\n *\n * The framework can use `new Parent()` to handle the `aService` dependency\n * in a specific way.\n *\n * @exportedAs angular2/di_annotations\n */\nexport class DependencyAnnotation {\n  @CONST()\n  constructor() {\n  }\n\n  get token() {\n    return null;\n  }\n}\n\n/**\n * A marker annotation that marks a class as available to `Injector` for creation. Used by tooling for\n * generating constructor stubs.\n *\n * ```\n * class NeedsService {\n *   constructor(svc:UsefulService) {}\n * }\n *\n * @Injectable\n * class UsefulService {}\n * ```\n * @exportedAs angular2/di_annotations\n */\nexport class Injectable {\n  @CONST()\n  constructor() {\n  }\n}\n"]}