UNPKG

angular2

Version:

Angular 2 - a web framework for modern web apps

1 lines 3.23 kB
{"version":3,"sources":["di.js"],"names":[],"mappings":"AAAA,KAAO,EAAC,KAAI,CAAC,KAAO,2BAAyB,CAAC;AAC9C,KAAO,EAAC,oBAAmB,CAAC,KAAO,cAAY,CAAC;AAWhD,KAAO,MAAM,eAAa,QAAU,qBAAmB;AAErD,AACA,YAAU,CAAE,QAAO,CAAG;AACpB,QAAI,AAAC,EAAC,CAAC;AACP,OAAG,SAAS,EAAI,SAAO,CAAC;EAC1B;AAAA,AAEA,IAAI,MAAI,EAAI;AACV,SAAO,SAAO,CAAC;EACjB;AAAA,AACF;AAAA,AAvBA,KAAK,eAAe,AAAC,+BACb,EAAC,GAAE,CAAG,UAAS,AAAD,CAAG;AAAC,cAavB,MAAI,AAAC,EAAC,EAbwC;EAAC,CAAC,CAAC,CAAC;AAoDrD,KAAO,MAAM,UAAQ,QAAU,qBAAmB;AAEhD,AACA,YAAU,CAAE,aAAY,CAAG;AACzB,QAAI,AAAC,EAAC,CAAC;AACP,OAAG,cAAc,EAAI,cAAY,CAAC;EACpC;AAAA,AAEA,IAAI,MAAI,EAAI;AAKV,SAAO,KAAG,CAAC;EACb;AAAA,AACF;AAAA,AApEA,KAAK,eAAe,AAAC,0BACb,EAAC,GAAE,CAAG,UAAS,AAAD,CAAG;AAAC,cAsDvB,MAAI,AAAC,EAAC,EAtDwC;EAAC,CAAC,CAAC,CAAC;AA4ErD,KAAO,MAAM,MAAI,QAAU,qBAAmB;AAE5C,AACA,YAAU,CAAE,SAAQ,CAAG;AACrB,QAAI,AAAC,EAAC,CAAC;AACP,OAAG,UAAU,EAAI,UAAQ,CAAC;EAC5B;AAAA,AACF;AAAA,AApFA,KAAK,eAAe,AAAC,sBACb,EAAC,GAAE,CAAG,UAAS,AAAD,CAAG;AAAC,cA8EvB,MAAI,AAAC,EAAC,EA9EwC;EAAC,CAAC,CAAC,CAAC;AAoFrD","file":"angular2/src/core/annotations/di.es6","sourcesContent":["import {CONST} from 'angular2/src/facade/lang';\nimport {DependencyAnnotation} from 'angular2/di';\n\n/**\n * Specifies that a function for setting host properties should be injected.\n *\n * NOTE: This is changing pre 1.0.\n *\n * The directive can inject a property setter that would allow setting this property on the host element.\n *\n * @exportedAs angular2/annotations\n */\nexport class PropertySetter extends DependencyAnnotation {\n propName: string;\n @CONST()\n constructor(propName) {\n super();\n this.propName = propName;\n }\n\n get token() {\n return Function;\n }\n}\n\n/**\n * Specifies that a constant attribute value should be injected.\n *\n * The directive can inject constant string literals of host element attributes.\n *\n * ## Example\n *\n * Suppose we have an `<input>` element and want to know its `type`.\n *\n * ```html\n * <input type=\"text\">\n * ```\n *\n * A decorator can inject string literal `text` like so:\n *\n * ```javascript\n * @Decorator({\n * selector: `input'\n * })\n * class InputDecorator {\n * constructor(@Attribute('type') type) {\n * // type would be `text` in this example\n * }\n * }\n * ```\n *\n * @exportedAs angular2/annotations\n */\nexport class Attribute extends DependencyAnnotation {\n attributeName: string;\n @CONST()\n constructor(attributeName) {\n super();\n this.attributeName = attributeName;\n }\n\n get token() {\n //Normally one would default a token to a type of an injected value but here\n //the type of a variable is \"string\" and we can't use primitive type as a return value\n //so we use instance of Attribute instead. This doesn't matter much in practice as arguments\n //with @Attribute annotation are injected by ElementInjector that doesn't take tokens into account.\n return this;\n }\n}\n\n/**\n * Specifies that a {@link QueryList} should be injected.\n *\n * See {@link QueryList} for usage and example.\n *\n * @exportedAs angular2/annotations\n */\nexport class Query extends DependencyAnnotation {\n directive;\n @CONST()\n constructor(directive) {\n super();\n this.directive = directive;\n }\n}\n"]}