填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

FormsModule

导出模板驱动表单所需的提供者和指令,使其可用于导入了该模块的 NgModule 中。

Exports the required providers and directives for template-driven forms, making them available for import by NgModules that import this module.

查看"说明"...

      
      class FormsModule {
}
    

参见

说明

Providers associated with this module:

  • RadioControlRegistry

指令

名称说明
      
      CheckboxControlValueAccessor
    

一个 ControlValueAccessor,用于写入值并监听复选框输入元素上的更改。

A ControlValueAccessor for writing a value and listening to changes on a checkbox input element.

      
      CheckboxRequiredValidator
    

该指令会借助 NG_VALIDATORS 绑定把 required 验证器添加到任何带有 required 属性的检查框控件上。

A Directive that adds the required validator to checkbox controls marked with the required attribute. The directive is provided with the NG_VALIDATORS multi-provider list.

      
      DefaultValueAccessor
    

The default ControlValueAccessor for writing a value and listening to changes on input elements. The accessor is used by the FormControlDirective, FormControlName, and NgModel directives.

      
      EmailValidator
    

该指令会借助 NG_VALIDATORS 绑定把 email 验证器添加到任何带有 email 属性的控件上。

A directive that adds the email validator to controls marked with the email attribute. The directive is provided with the NG_VALIDATORS multi-provider list.

      
      MaxLengthValidator
    

该指令用于为带有 maxlength 属性的控件添加最大长度验证器。该指令会提供 NG_VALIDATORS 多重提供者列表。

A directive that adds max length validation to controls marked with the maxlength attribute. The directive is provided with the NG_VALIDATORS multi-provider list.

      
      MaxValidator
    

A directive which installs the MaxValidatorfor any formControlName, formControl, or control with ngModel that also has a max attribute.

      
      MinLengthValidator
    

该指令用于为带有 minlength 属性的控件添加最小长度验证器。该指令会提供 NG_VALIDATORS 多重提供者列表。

A directive that adds minimum length validation to controls marked with the minlength attribute. The directive is provided with the NG_VALIDATORS multi-provider list.

      
      MinValidator
    

A directive which installs the MinValidatorfor any formControlName, formControl, or control with ngModel that also has a min attribute.

      
      NgControlStatus
    

指令自动应用于 Angular 表单控件,该控件会根据控件状态设置 CSS 类。

Directive automatically applied to Angular form controls that sets CSS classes based on control status.

      
      NgControlStatusGroup
    

该指令自动应用于 Angular 表单组,基于控件的状态(有效、无效、脏等)设置 CSS 类。

Directive automatically applied to Angular form groups that sets CSS classes based on control status (valid/invalid/dirty/etc).

      
      NgForm
    

创建一个顶级的 FormGroup 实例,并把它绑定到一个表单,以跟踪表单的聚合值及其验证状态。

Creates a top-level FormGroup instance and binds it to a form to track aggregate form value and validation status.

      
      NgModel
    

根据领域对象创建一个 FormControl 实例,并把它绑定到一个表单控件元素上。

Creates a FormControl instance from a domain model and binds it to a form control element.

      
      NgModelGroup
    

创建 FormGroup 的实例并将其绑定到 DOM 元素。

Creates and binds a FormGroup instance to a DOM element.

      
      NgSelectOption
    

把选项 <option> 标记为动态的,这样 Angular 就会在选项变化时得到通知。

Marks <option> as dynamic, so Angular can be notified when options change.

      
      NumberValueAccessor
    

用于写入数字值和监听数字输入框更改的 ControlValueAccessor。这个值访问器由 FormControlDirectiveFormControlNameNgModel 指令使用。

The ControlValueAccessor for writing a number value and listening to number input changes. The value accessor is used by the FormControlDirective, FormControlName, and NgModel directives.

      
      PatternValidator
    

该指令会借助 NG_VALIDATORS 绑定来把 pattern 验证器添加到任何带有 pattern 属性的控件上。 它会使用该属性的值作为正则表达式来验证控件的值。 它会遵循 pattern 属性的语义,也就是说,该正则表达式必须匹配整个控件值。

A directive that adds regex pattern validation to controls marked with the pattern attribute. The regex must match the entire control value. The directive is provided with the NG_VALIDATORS multi-provider list.

      
      RadioControlValueAccessor
    

ControlValueAccessor 用于写入单选控件的值和监听单选控件值的更改。这个值访问器由 FormControlDirectiveFormControlNameNgModel 指令使用。

The ControlValueAccessor for writing radio control values and listening to radio control changes. The value accessor is used by the FormControlDirective, FormControlName, and NgModel directives.

      
      RangeValueAccessor
    

ControlValueAccessor 用于写入范围输入器的值,并监听范围输入器的变化。它被 FormControlDirectiveFormControlNameNgModel 使用。

The ControlValueAccessor for writing a range value and listening to range input changes. The value accessor is used by the FormControlDirective, FormControlName, and NgModel directives.

      
      RequiredValidator
    

该指令会借助 NG_VALIDATORS 绑定把 required 验证器添加到任何带 required 属性的控件上。

A directive that adds the required validator to any controls marked with the required attribute. The directive is provided with the NG_VALIDATORS multi-provider list.

      
      SelectControlValueAccessor
    

ControlValueAccessor 用于写入 select 控件的值,并监听 select 控件的变化。该值访问器会被 FormControlDirectiveFormControlNameNgModel 指令使用。

The ControlValueAccessor for writing select control values and listening to select control changes. The value accessor is used by the FormControlDirective, FormControlName, and NgModel directives.

      
      SelectMultipleControlValueAccessor
    

ControlValueAccessor 用于写入多选控件值和监听多选控件更改。这个值访问器由 FormControlDirectiveFormControlNameNgModel 指令使用。

The ControlValueAccessor for writing multi-select control values and listening to multi-select control changes. The value accessor is used by the FormControlDirective, FormControlName, and NgModel directives.