docs(API): 翻译完了 TemplateRef

This commit is contained in:
Zhicheng Wang 2018-09-04 10:39:27 +08:00
parent 46a2608476
commit 986872ecbd
2 changed files with 17 additions and 1 deletions

View File

@ -49,7 +49,7 @@
[x] | common/DecimalPipe | 0.40 [x] | common/DecimalPipe | 0.40
[x] | common/CurrencyPipe | 0.39 [x] | common/CurrencyPipe | 0.39
[x] | router/RouterLinkActive | 0.38 [x] | router/RouterLinkActive | 0.38
[ ] | core/TemplateRef | 0.38 [x] | core/TemplateRef | 0.38
[ ] | forms/FormBuilder | 0.37 [ ] | forms/FormBuilder | 0.37
[ ] | common/http/HttpParams | 0.35 [ ] | common/http/HttpParams | 0.35
[ ] | core/OnChanges | 0.35 [ ] | core/OnChanges | 0.35

View File

@ -13,26 +13,42 @@ import {EmbeddedViewRef} from './view_ref';
/** /**
* Represents an Embedded Template that can be used to instantiate Embedded Views. * Represents an Embedded Template that can be used to instantiate Embedded Views.
* *
*
*
* You can access a `TemplateRef`, in two ways. Via a directive placed on a `<ng-template>` element * You can access a `TemplateRef`, in two ways. Via a directive placed on a `<ng-template>` element
* (or directive prefixed with `*`) and have the `TemplateRef` for this Embedded View injected into * (or directive prefixed with `*`) and have the `TemplateRef` for this Embedded View injected into
* the constructor of the directive using the `TemplateRef` Token. Alternatively you can query for * the constructor of the directive using the `TemplateRef` Token. Alternatively you can query for
* the `TemplateRef` from a Component or a Directive via {@link Query}. * the `TemplateRef` from a Component or a Directive via {@link Query}.
* *
* 访 `TemplateRef` `<ng-template>` `*`
* `TemplateRef`
* {@link Query} `TemplateRef`
*
* To instantiate Embedded Views based on a Template, use {@link ViewContainerRef# * To instantiate Embedded Views based on a Template, use {@link ViewContainerRef#
* createEmbeddedView}, which will create the View and attach it to the View Container. * createEmbeddedView}, which will create the View and attach it to the View Container.
* *
* 使 {@link ViewContainerRef# createEmbeddedView}
*
*
*/ */
export abstract class TemplateRef<C> { export abstract class TemplateRef<C> {
/** /**
* The location in the View where the Embedded View logically belongs to. * The location in the View where the Embedded View logically belongs to.
* *
*
*
* The data-binding and injection contexts of Embedded Views created from this `TemplateRef` * The data-binding and injection contexts of Embedded Views created from this `TemplateRef`
* inherit from the contexts of this location. * inherit from the contexts of this location.
* *
* `TemplateRef`
*
* Typically new Embedded Views are attached to the View Container of this location, but in * Typically new Embedded Views are attached to the View Container of this location, but in
* advanced use-cases, the View can be attached to a different container while keeping the * advanced use-cases, the View can be attached to a different container while keeping the
* data-binding and injection context from the original location. * data-binding and injection context from the original location.
* *
*
*
*
*/ */
// TODO(i): rename to anchor or location // TODO(i): rename to anchor or location
abstract get elementRef(): ElementRef; abstract get elementRef(): ElementRef;