ForwardRefFn

Experimental Interface Interface Overview interface ForwardRefFn { } Interface Description An interface that a function passed into forwardRef has to implement. Example let ref = forwardRef(() => Lock); exported from @angular/core/index, defined in @angular/core/src/di/forward_ref.ts

forwardRef()

Experimental Function Class Export export forwardRef(forwardRefFn: ForwardRefFn) : Type<any> Allows to refer to references which are not yet defined. For instance, forwardRef is used when the token which we need to refer to for the purposes of DI is declared, but not yet defined. It is also used when the token which we use when creating a query is not yet defined. Example class Door { lock: Lock; // Door attempts to inject Lock, despite it not being defined yet. // forwardRef ma

FormsModule

Stable Class Class Overview class FormsModule { } Class Description The ng module for forms. Annotations @NgModule({ declarations: TEMPLATE_DRIVEN_DIRECTIVES, providers: [RadioControlRegistry], exports: [InternalFormsSharedModule, TEMPLATE_DRIVEN_DIRECTIVES] }) exported from @angular/forms/index, defined in @angular/forms/src/form_providers.ts

forms

Module Entry point for all public APIs of the forms package. AbstractControl AbstractControlDirective AbstractFormGroupDirective AsyncValidatorFn CheckboxControlValueAccessor ControlContainer ControlValueAccessor DefaultValueAccessor Form FormArray FormArrayName FormBuilder FormControl FormControlDirective FormControlName FormGroup FormGroupDirective FormGroupName FormsModule MaxLengthValidator MinLengthValidator NG_ASYNC_VALIDATORS NG_VALIDATORS NG_VALUE_ACCESSOR NgControl NgControlStatus NgCo

FormGroupName

Stable Directive What it does Syncs a nested FormGroup to a DOM element. How to use This directive can only be used with a parent FormGroupDirective (selector: [formGroup]). It accepts the string name of the nested FormGroup you want to link, and will look for a FormGroup registered with that name in the parent FormGroup instance you passed into FormGroupDirective. Nested form groups can come in handy when you want to validate a sub-group of a form separately from the rest or when you'd li

FormGroupDirective

Stable Directive What it does Binds an existing FormGroup to a DOM element. How to use This directive accepts an existing FormGroup instance. It will then use this FormGroup instance to match any child FormControl, FormGroup, and FormArray instances to child FormControlName, FormGroupName, and FormArrayName directives. Set value: You can set the form's initial value when instantiating the FormGroup, or you can set it programmatically later using the FormGroup's setValue or patchValue metho

FormGroup

Stable Class What it does Tracks the value and validity state of a group of FormControl instances. A FormGroup aggregates the values of each child FormControl into one object, with each control name as the key. It calculates its status by reducing the statuses of its children. For example, if one of the controls in a group is invalid, the entire group becomes invalid. FormGroup is one of the three fundamental building blocks used to define forms in Angular, along with FormControl and FormArr

FormControlName

Stable Directive What it does Syncs a FormControl in an existing FormGroup to a form control element by name. In other words, this directive ensures that any values written to the FormControl instance programmatically will be written to the DOM element (model -> view). Conversely, any values written to the DOM element through user input will be reflected in the FormControl instance (view -> model). How to use This directive is designed to be used with a parent FormGroupDirective (sel

FormControlDirective

Stable Directive What it does Syncs a standalone FormControl instance to a form control element. In other words, this directive ensures that any values written to the FormControl instance programmatically will be written to the DOM element (model -> view). Conversely, any values written to the DOM element through user input will be reflected in the FormControl instance (view -> model). How to use Use this directive if you'd like to create and manage a FormControl instance directly. S

FormControl

Stable Class What it does Tracks the value and validation status of an individual form control. It is one of the three fundamental building blocks of Angular forms, along with FormGroup and FormArray. How to use When instantiating a FormControl, you can pass in an initial value as the first argument. Example: const ctrl = new FormControl('some value'); console.log(ctrl.value); // 'some value' You can also initialize the control with a form state object on instantiation, which includes