2015-02-05 13:08:05 -08:00
|
|
|
import {ABSTRACT, CONST, Type} from 'angular2/src/facade/lang';
|
2014-09-19 16:38:37 -07:00
|
|
|
|
2015-03-17 19:22:13 +00:00
|
|
|
/**
|
2015-03-30 17:19:27 -07:00
|
|
|
* Declare the available HTML templates for an application.
|
|
|
|
*
|
2015-04-09 21:20:11 +02:00
|
|
|
* Each angular component requires a single `@Component` and at least one `@View` annotation. The @View
|
2015-03-30 17:19:27 -07:00
|
|
|
* annotation specifies the HTML template to use, and lists the directives that are active within the template.
|
|
|
|
*
|
|
|
|
* When a component is instantiated, the template is loaded into the component's shadow root, and the
|
|
|
|
* expressions and statements in the template are evaluated against the component.
|
|
|
|
*
|
|
|
|
* For details on the `@Component` annotation, see [Component].
|
|
|
|
*
|
|
|
|
* ## Example
|
|
|
|
*
|
|
|
|
* ```
|
|
|
|
* @Component({
|
|
|
|
* selector: 'greet'
|
|
|
|
* })
|
2015-04-09 21:20:11 +02:00
|
|
|
* @View({
|
|
|
|
* template: 'Hello {{name}}!'
|
2015-03-30 17:19:27 -07:00
|
|
|
* })
|
|
|
|
* class Greet {
|
|
|
|
* name: string;
|
|
|
|
*
|
|
|
|
* constructor() {
|
|
|
|
* this.name = 'World';
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
* ```
|
|
|
|
*
|
2015-04-10 12:45:02 +02:00
|
|
|
* @exportedAs angular2/annotations
|
2015-03-17 19:22:13 +00:00
|
|
|
*/
|
2015-04-09 21:20:11 +02:00
|
|
|
export class View {
|
|
|
|
templateUrl:any; //string;
|
|
|
|
template:any; //string;
|
2014-11-21 21:19:23 -08:00
|
|
|
directives:any; //List<Type>;
|
|
|
|
formatters:any; //List<Type>;
|
2015-04-09 21:20:11 +02:00
|
|
|
source:any;//List<View>;
|
2015-02-12 14:44:59 +01:00
|
|
|
locale:any; //string
|
|
|
|
device:any; //string
|
2014-10-02 21:48:46 -07:00
|
|
|
@CONST()
|
2014-09-25 16:53:32 -07:00
|
|
|
constructor({
|
2015-04-09 21:20:11 +02:00
|
|
|
templateUrl,
|
|
|
|
template,
|
2014-09-19 16:38:37 -07:00
|
|
|
directives,
|
|
|
|
formatters,
|
2015-02-12 14:44:59 +01:00
|
|
|
source,
|
|
|
|
locale,
|
|
|
|
device
|
2014-10-02 21:48:46 -07:00
|
|
|
}: {
|
2015-04-09 21:20:11 +02:00
|
|
|
templateUrl: string,
|
|
|
|
template: string,
|
2014-09-19 16:38:37 -07:00
|
|
|
directives: List<Type>,
|
|
|
|
formatters: List<Type>,
|
2015-04-09 21:20:11 +02:00
|
|
|
source: List<View>,
|
2015-02-12 14:44:59 +01:00
|
|
|
locale: string,
|
|
|
|
device: string
|
2014-10-02 21:48:46 -07:00
|
|
|
})
|
|
|
|
{
|
2015-04-09 21:20:11 +02:00
|
|
|
this.templateUrl = templateUrl;
|
|
|
|
this.template = template;
|
2014-10-02 21:48:46 -07:00
|
|
|
this.directives = directives;
|
|
|
|
this.formatters = formatters;
|
|
|
|
this.source = source;
|
2015-02-12 14:44:59 +01:00
|
|
|
this.locale = locale;
|
|
|
|
this.device = device;
|
2014-10-02 21:48:46 -07:00
|
|
|
}
|
|
|
|
}
|