angular2
Version:
Angular 2 - a web framework for modern web apps
1 lines • 3.22 kB
Source Map (JSON)
{"version":3,"sources":["view.js"],"names":[],"mappings":"AAAA;AAAA,KAAK,iBAAiB,AAAC,CAAC,MAAK,QAAQ;MAArC,EAAC,GAAE,YAAqB;AAAE,iBAAwB;IAAE,AAA9B,CAAC;AAAvB,WAAS,CAAT,EAAC,KAAI,CAAO,KAAG,AAAS,CAAC;CAAgC,CAAC;;SAA1D,EAAC,wCAAoB,CAAA,OAAM,AAAC,4BAAkB,CACtC,CAAA,yCAAqB,kDAA2B,CAAA,yCAAqB,GAAK,EAAC,OAAM,wCAAmB,CAAC,AAD/D,CACgE;AADtG,WAAO;AAAG,QAAI;AAAG,OAAG;AAA5B,AAAI,EAAA,OAkCG,SAAM,KAAG,CA8CF,IAUV;;AATE,gBAAU;AACV,aAAO;AACP,eAAS;AACT,aAAO;AAQT,KAAG,YAAY,EAAI,YAAU,CAAC;AAC9B,KAAG,SAAS,EAAI,SAAO,CAAC;AACxB,KAAG,WAAW,EAAI,WAAS,CAAC;AAC5B,KAAG,SAAS,EAAI,SAAO,CAAC;AAE5B,AAjGwC,CAAA;AAAxC,AAAC,eAAc,YAAY,CAAC,AAAC,cAAwD;AAArF,KAAK,eAAe,AAAC,qBACb,EAAC,GAAE,CAAG,UAAS,AAAD,CAAG;AAAC,cA8EvB,MAAI,AAAC,EAAC,EA9EwC;EAAC,CAAC,CAAC,CAAC;AAiGrD","file":"angular2/src/core/annotations/view.js","sourcesContent":["import {ABSTRACT, CONST, Type} from 'angular2/src/facade/lang';\n\n/**\n * Declares the available HTML templates for an application.\n *\n * Each angular component requires a single `@Component` and at least one `@View` annotation. The @View\n * annotation specifies the HTML template to use, and lists the directives that are active within the template.\n *\n * When a component is instantiated, the template is loaded into the component's shadow root, and the\n * expressions and statements in the template are evaluated against the component.\n *\n * For details on the `@Component` annotation, see {@link Component}.\n *\n * ## Example\n *\n * ```\n * @Component({\n * selector: 'greet'\n * })\n * @View({\n * template: 'Hello {{name}}!',\n * directives: [GreetUser, Bold]\n * })\n * class Greet {\n * name: string;\n *\n * constructor() {\n * this.name = 'World';\n * }\n * }\n * ```\n *\n * @exportedAs angular2/annotations\n */\nexport class View {\n /**\n * Specifies a template URL for an angular component.\n *\n * NOTE: either `templateURL` or `template` should be used, but not both.\n */\n templateUrl:any; //string;\n\n /**\n * Specifies an inline template for an angular component.\n *\n * NOTE: either `templateURL` or `template` should be used, but not both.\n */\n template:any; //string;\n\n /**\n * Specifies a list of directives that can be used within a template.\n *\n * Directives must be listed explicitly to provide proper component encapsulation.\n *\n * ## Example\n *\n * ```javascript\n * @Component({\n * selector: 'my-component'\n * })\n * @View({\n * directives: [For]\n * template: '\n * <ul>\n * <li *for=\"item in items\">{{item}}</li>\n * </ul>'\n * })\n * class MyComponent {\n * }\n * ```\n */\n directives:any; //List<Type>;\n\n /**\n * Specify a custom renderer for this View.\n * If this is set, neither `template`, `templateURL` nor `directives` are used.\n */\n renderer:any; // string;\n\n @CONST()\n constructor({\n templateUrl,\n template,\n directives,\n renderer\n }: {\n templateUrl: string,\n template: string,\n directives: List<Type>,\n renderer: string\n })\n {\n this.templateUrl = templateUrl;\n this.template = template;\n this.directives = directives;\n this.renderer = renderer;\n }\n}\n"]}