angular2
Version:
Angular 2 - a web framework for modern web apps
1 lines • 2.96 kB
Source Map (JSON)
{"version":3,"sources":["view.js"],"names":[],"mappings":"AAAA,KAAO,EAAC,QAAO;AAAG,MAAI;AAAG,KAAG,CAAC,KAAO,2BAAyB,CAAC;AAkC9D,KAAO,MAAM,KAAG;AA6Cd,AACA,YAAU,CAAE,CACR,WAAU;AACV,WAAO;AACP,aAAS;AACT,WAAO,CACT,AAKA,CACF;AACE,OAAG,YAAY,EAAI,YAAU,CAAC;AAC9B,OAAG,SAAS,EAAI,SAAO,CAAC;AACxB,OAAG,WAAW,EAAI,WAAS,CAAC;AAC5B,OAAG,SAAS,EAAI,SAAO,CAAC;EAC1B;AAAA,AACF;AAAA,AAjGA,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.es6","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"]}