docs(annotations): Added new text

This commit is contained in:
Naomi Black
2015-03-30 17:19:27 -07:00
parent ed5975d3e5
commit 3915e1b242
3 changed files with 36 additions and 9 deletions

View File

@ -445,18 +445,17 @@ export class Directive extends Injectable {
}
/**
* Declare template views for an Angular application.
* Declare reusable UI building blocks for an application.
*
* Each angular component requires a single `@Component` and at least one `@Template` annotation. This allows Angular to
* encapsulate state information and templates. These form the fundamental reusable building blocks for developing an
* application. There can only be one component per DOM element.
* Each angular component requires a single `@Component` and at least one `@Template` annotation. The @Component
* annotation specifies when a component is instantiated, and which properties and events it binds to.
*
* When a component is instantiated, Angular
* - creates a shadow DOM for the component.
* - loads the selected template into the shadow DOM.
* - creates a child [Injector] which is configured with the [Component.services].
*
* All template expressions and statments are then evaluted against the component instance.
* All template expressions and statements are then evaluated against the component instance.
*
* For details on the `@Template` annotation, see [Template].
*

View File

@ -1,6 +1,34 @@
import {ABSTRACT, CONST, Type} from 'angular2/src/facade/lang';
/**
* Declare the available HTML templates for an application.
*
* Each angular component requires a single `@Component` and at least one `@Template` annotation. The @Template
* 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'
* })
* @Template({
* inline: 'Hello {{name}}!'
* })
* class Greet {
* name: string;
*
* constructor() {
* this.name = 'World';
* }
* }
* ```
*
* @publicModule angular2/annotations
*/
export class Template {