This is the archived documentation for Angular v6. Please visit angular.io to see documentation for the current version of Angular.

ReactiveFormsModule

Exports the required infrastructure and directives for reactive forms, making them available for import by NgModules that import this module.

      
      class ReactiveFormsModule {
  static withConfig(opts: {...}): ModuleWithProviders<ReactiveFormsModule>
}
    

See also

Static methods

Provides options for configuring the reactive forms module.

static withConfig(opts: { warnOnNgModelWithFormControl: 'never' | 'once' | 'always'; }): ModuleWithProviders<ReactiveFormsModule>
      
      static withConfig(opts: {
    warnOnNgModelWithFormControl: 'never' | 'once' | 'always';
}): ModuleWithProviders<ReactiveFormsModule>
    

Parameters

opts

An object of configuration options warnOnNgModelWithFormControl Configures when to emit a warning when an `ngModel binding is used with reactive form directives.

Returns

ModuleWithProviders<ReactiveFormsModule>

Providers

Provider
      
      FormBuilder
    
RadioControlRegistry
      
      RadioControlRegistry
    

Directives

NameDescription
CheckboxControlValueAccessor
      
      CheckboxControlValueAccessor
    

The accessor for writing a value and listening to changes on a checkbox input element.

CheckboxRequiredValidator
      
      CheckboxRequiredValidator
    

A Directive that adds the required validator to checkbox controls marked with the required attribute, via the NG_VALIDATORS binding.

DefaultValueAccessor
      
      DefaultValueAccessor
    

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

EmailValidator
      
      EmailValidator
    

A Directive that adds the email validator to controls marked with the email attribute, via the NG_VALIDATORS binding.

FormArrayName
      
      FormArrayName
    

Syncs a nested FormArray to a DOM element.

FormControlDirective
      
      FormControlDirective
    

Syncs a standalone FormControl instance to a form control element.

FormControlName
      
      FormControlName
    

Syncs a FormControl in an existing FormGroup to a form control element by name.

FormGroupDirective
      
      FormGroupDirective
    

Binds an existing FormGroup to a DOM element.

FormGroupName
      
      FormGroupName
    

Syncs a nested FormGroup to a DOM element.

MaxLengthValidator
      
      MaxLengthValidator
    

A directive which installs the MaxLengthValidator for any formControlName, formControl, or control with ngModel that also has a maxlength attribute.

MinLengthValidator
      
      MinLengthValidator
    

A directive which installs the MinLengthValidator for any formControlName, formControl, or control with ngModel that also has a minlength attribute.

NgControlStatus
      
      NgControlStatus
    

Directive automatically applied to Angular form controls that sets CSS classes based on control status. The following classes are applied as the properties become true:

NgControlStatusGroup
      
      NgControlStatusGroup
    

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

NgSelectOption
      
      NgSelectOption
    

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

PatternValidator
      
      PatternValidator
    

A Directive that adds the pattern validator to any controls marked with the pattern attribute, via the NG_VALIDATORS binding. Uses attribute value as the regex to validate Control value against. Follows pattern attribute semantics; i.e. regex must match entire Control value.

RadioControlValueAccessor
      
      RadioControlValueAccessor
    

Writes radio control values and listens to radio control changes.

RequiredValidator
      
      RequiredValidator
    

A Directive that adds the required validator to any controls marked with the required attribute, via the NG_VALIDATORS binding.

SelectControlValueAccessor
      
      SelectControlValueAccessor
    

Writes values and listens to changes on a select element.

SelectMultipleControlValueAccessor
      
      SelectMultipleControlValueAccessor
    

The accessor for writing a value and listening to changes on a select element.