From 0d7690251b5d6d090240d356f84e88bdc4ae8f82 Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Tue, 4 Sep 2018 15:56:04 +0800 Subject: [PATCH] =?UTF-8?q?docs(API):=20=E7=BF=BB=E8=AF=91=E5=AE=8C?= =?UTF-8?q?=E4=BA=86=20ComponentFactory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aio/content/translations/cn/api-plan.md | 2 +- packages/core/src/render3/component_ref.ts | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/aio/content/translations/cn/api-plan.md b/aio/content/translations/cn/api-plan.md index adaa8a544f..39bea14773 100644 --- a/aio/content/translations/cn/api-plan.md +++ b/aio/content/translations/cn/api-plan.md @@ -75,7 +75,7 @@ [x] | core/ChangeDetectorRef | 0.21 [x] | router/NavigationStart | 0.21 [x] | common/formatDate | 0.21 -[ ] | core/ComponentFactoryResolver | 0.20 +[x] | core/ComponentFactoryResolver | 0.20 [ ] | forms/Form | 0.20 [ ] | common/http/HttpErrorResponse | 0.20 [ ] | core/QueryList | 0.19 diff --git a/packages/core/src/render3/component_ref.ts b/packages/core/src/render3/component_ref.ts index 747adbcc7b..494c5455aa 100644 --- a/packages/core/src/render3/component_ref.ts +++ b/packages/core/src/render3/component_ref.ts @@ -46,6 +46,8 @@ function toRefArray(map: {[key: string]: string}): {propName: string; templateNa /** * Default {@link RootContext} for all components rendered with {@link renderComponent}. + * + * 通过 {@link renderComponent} 渲染所有组件时的默认 {@link RootContext}。 */ export const ROOT_CONTEXT = new InjectionToken( 'ROOT_CONTEXT_TOKEN', @@ -54,12 +56,16 @@ export const ROOT_CONTEXT = new InjectionToken( /** * A change detection scheduler token for {@link RootContext}. This token is the default value used * for the default `RootContext` found in the {@link ROOT_CONTEXT} token. + * + * 供 {@link RootContext} 使用的变更检测调度器的令牌。该令牌是供 {@link ROOT_CONTEXT} 对应的默认 `RootContext` 使用的默认值。 */ export const SCHEDULER = new InjectionToken<((fn: () => void) => void)>( 'SCHEDULER_TOKEN', {providedIn: 'root', factory: () => requestAnimationFrame.bind(window)}); /** * Render3 implementation of {@link viewEngine_ComponentFactory}. + * + * {@link viewEngine_ComponentFactory} 的 Render3 实现。 */ export class ComponentFactory extends viewEngine_ComponentFactory { selector: string; @@ -170,10 +176,14 @@ export class ComponentFactory extends viewEngine_ComponentFactory { /** * Represents an instance of a Component created via a {@link ComponentFactory}. * + * 表示通过 {@link ComponentFactory} 创建的组件的实例。 + * * `ComponentRef` provides access to the Component Instance as well other objects related to this * Component Instance and allows you to destroy the Component Instance via the {@link #destroy} * method. * + * `ComponentRef` 提供了对该组件实例及其相关对象的访问能力,并允许你通过 {@link #destroy} 方法销毁该实例。 + * */ export class ComponentRef extends viewEngine_ComponentRef { destroyCbs: (() => void)[]|null = [];