diff --git a/modules/angular2/src/core/annotations/annotations.js b/modules/angular2/src/core/annotations/annotations.js index 17632619b3..cf930eaada 100644 --- a/modules/angular2/src/core/annotations/annotations.js +++ b/modules/angular2/src/core/annotations/annotations.js @@ -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]. * diff --git a/modules/angular2/src/core/annotations/template.js b/modules/angular2/src/core/annotations/template.js index e034e8b80e..43f285fdd4 100644 --- a/modules/angular2/src/core/annotations/template.js +++ b/modules/angular2/src/core/annotations/template.js @@ -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 { diff --git a/modules/angular2/src/core/application.js b/modules/angular2/src/core/application.js index d466f0e339..0c95adef2f 100644 --- a/modules/angular2/src/core/application.js +++ b/modules/angular2/src/core/application.js @@ -148,8 +148,8 @@ function _createVmZone(givenReporter:Function): VmTurnZone { * An application is bootstrapped inside an existing browser DOM, typically `index.html`. Unlike Angular 1, Angular 2 * does not compile/process bindings in `index.html`. This is mainly for security reasons, as well as architectural * changes in Angular 2. This means that `index.html` can safely be processed using server-side technologies such as - * bindings. (which may use double-curly `{{ syntax }}` without collision from Angular 2 component double-curly - * `{{ syntax }}`.) + * bindings. Bindings can thus use double-curly `{{ syntax }}` without collision from Angular 2 component double-curly + * `{{ syntax }}`. * * We can use this script code: * @@ -204,8 +204,8 @@ function _createVmZone(givenReporter:Function): VmTurnZone { * * If you need to bootstrap multiple applications that share common data, the applications must share a common * change detection and zone. To do that, create a meta-component that lists the application components in its template. - * By only invoking the `bootstrap()` method once, with the meta-component as its argument, you ensure that only a single - * change detection zone is created and therefore data can be shared across the applications. + * By only invoking the `bootstrap()` method once, with the meta-component as its argument, you ensure that only a + * single change detection zone is created and therefore data can be shared across the applications. * * * ## Primordial Injector