From 2a1fbec87988e29de160e18e73817c808fd03e2a Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Tue, 4 Sep 2018 16:00:05 +0800 Subject: [PATCH] =?UTF-8?q?docs(API):=20=E7=BF=BB=E8=AF=91=E5=AE=8C?= =?UTF-8?q?=E4=BA=86=20forms/Form?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aio/content/translations/cn/api-plan.md | 2 +- .../forms/src/directives/form_interface.ts | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/aio/content/translations/cn/api-plan.md b/aio/content/translations/cn/api-plan.md index 39bea14773..61d8e10a3c 100644 --- a/aio/content/translations/cn/api-plan.md +++ b/aio/content/translations/cn/api-plan.md @@ -76,7 +76,7 @@ [x] | router/NavigationStart | 0.21 [x] | common/formatDate | 0.21 [x] | core/ComponentFactoryResolver | 0.20 -[ ] | forms/Form | 0.20 +[x] | forms/Form | 0.20 [ ] | common/http/HttpErrorResponse | 0.20 [ ] | core/QueryList | 0.19 [ ] | forms | 0.19 diff --git a/packages/forms/src/directives/form_interface.ts b/packages/forms/src/directives/form_interface.ts index d2790aa1d8..efa06568b2 100644 --- a/packages/forms/src/directives/form_interface.ts +++ b/packages/forms/src/directives/form_interface.ts @@ -16,43 +16,59 @@ import {NgControl} from './ng_control'; /** * An interface that `FormGroupDirective` and `NgForm` implement. * + * 由 `FormGroupDirective` 和 `NgForm` 实现的接口。 + * * Only used by the forms module. * - * + * 只用于表单模块。 */ export interface Form { /** * Add a control to this form. + * + * 把控件添加到该表单中。 */ addControl(dir: NgControl): void; /** * Remove a control from this form. + * + * 从该表单中移除控件。 */ removeControl(dir: NgControl): void; /** * Look up the `FormControl` associated with a particular `NgControl`. + * + * 查找与指定的 `NgControl` 相关的 `FormControl`。 */ getControl(dir: NgControl): FormControl; /** * Add a group of controls to this form. + * + * 往该表单中添加一组控件。 */ addFormGroup(dir: AbstractFormGroupDirective): void; /** * Remove a group of controls from this form. + * + * 从该表单中移除一组控件。 */ removeFormGroup(dir: AbstractFormGroupDirective): void; /** * Look up the `FormGroup` associated with a particular `AbstractFormGroupDirective`. + * + * 查找与指定的 `AbstractFormGroupDirective` 相关的 `FormGroup`。 */ getFormGroup(dir: AbstractFormGroupDirective): FormGroup; /** * Update the model for a particular control with a new value. + * + * 把指定控件的表单模型修改为新的值。 */ updateModel(dir: NgControl, value: any): void; }