
committed by
Matias Niemelä

parent
6fbc2b3be0
commit
901436e46f
@ -40,7 +40,7 @@ export const formGroupNameProvider: any = {
|
||||
* controls into their own nested object.
|
||||
*
|
||||
* **Access the group**: You can access the associated {@link FormGroup} using the
|
||||
* {@link AbstractControl#get} method. Ex: `this.form.get('name')`.
|
||||
* {@link AbstractControl#get get} method. Ex: `this.form.get('name')`.
|
||||
*
|
||||
* You can also access individual controls within the group using dot syntax.
|
||||
* Ex: `this.form.get('name.first')`
|
||||
@ -111,7 +111,7 @@ export const formArrayNameProvider: any = {
|
||||
* form controls dynamically.
|
||||
*
|
||||
* **Access the array**: You can access the associated {@link FormArray} using the
|
||||
* {@link AbstractControl#get} method on the parent {@link FormGroup}.
|
||||
* {@link AbstractControl#get get} method on the parent {@link FormGroup}.
|
||||
* Ex: `this.form.get('cities')`.
|
||||
*
|
||||
* **Get the value**: the `value` property is always synced and available on the
|
||||
@ -119,17 +119,17 @@ export const formArrayNameProvider: any = {
|
||||
*
|
||||
* **Set the value**: You can set an initial value for each child control when instantiating
|
||||
* the {@link FormArray}, or you can set the value programmatically later using the
|
||||
* {@link FormArray}'s {@link AbstractControl#setValue} or {@link AbstractControl#patchValue}
|
||||
* methods.
|
||||
* {@link FormArray}'s {@link AbstractControl#setValue setValue} or
|
||||
* {@link AbstractControl#patchValue patchValue} methods.
|
||||
*
|
||||
* **Listen to value**: If you want to listen to changes in the value of the array, you can
|
||||
* subscribe to the {@link FormArray}'s {@link AbstractControl#valueChanges} event. You can also
|
||||
* listen to its {@link AbstractControl#statusChanges} event to be notified when the validation
|
||||
* status is re-calculated.
|
||||
* subscribe to the {@link FormArray}'s {@link AbstractControl#valueChanges valueChanges} event.
|
||||
* You can also listen to its {@link AbstractControl#statusChanges statusChanges} event to be
|
||||
* notified when the validation status is re-calculated.
|
||||
*
|
||||
* **Add new controls**: You can add new controls to the {@link FormArray} dynamically by
|
||||
* calling its {@link FormArray#push} method.
|
||||
* Ex: `this.form.get('cities').push(new FormControl());`
|
||||
* **Add new controls**: You can add new controls to the {@link FormArray} dynamically by calling
|
||||
* its {@link FormArray#push push} method.
|
||||
* Ex: `this.form.get('cities').push(new FormControl());`
|
||||
*
|
||||
* ### Example
|
||||
*
|
||||
|
@ -755,9 +755,9 @@ export class FormControl extends AbstractControl {
|
||||
/**
|
||||
* Patches the value of a control.
|
||||
*
|
||||
* This function is functionally the same as {@link FormControl#setValue} at this level.
|
||||
* It exists for symmetry with {@link FormGroup#patchValue} on `FormGroups` and `FormArrays`,
|
||||
* where it does behave differently.
|
||||
* This function is functionally the same as {@link FormControl#setValue setValue} at this level.
|
||||
* It exists for symmetry with {@link FormGroup#patchValue patchValue} on `FormGroups` and
|
||||
* `FormArrays`, where it does behave differently.
|
||||
*/
|
||||
patchValue(value: any, options: {
|
||||
onlySelf?: boolean,
|
||||
@ -956,8 +956,8 @@ export class FormGroup extends AbstractControl {
|
||||
/**
|
||||
* Registers a control with the group's list of controls.
|
||||
*
|
||||
* This method does not update value or validity of the control, so for
|
||||
* most cases you'll want to use {@link FormGroup#addControl} instead.
|
||||
* This method does not update the value or validity of the control, so for most cases you'll want
|
||||
* to use {@link FormGroup#addControl addControl} instead.
|
||||
*/
|
||||
registerControl(name: string, control: AbstractControl): AbstractControl {
|
||||
if (this.controls[name]) return this.controls[name];
|
||||
@ -1000,8 +1000,8 @@ export class FormGroup extends AbstractControl {
|
||||
/**
|
||||
* Check whether there is an enabled control with the given name in the group.
|
||||
*
|
||||
* It will return false for disabled controls. If you'd like to check for
|
||||
* existence in the group only, use {@link AbstractControl#get} instead.
|
||||
* It will return false for disabled controls. If you'd like to check for existence in the group
|
||||
* only, use {@link AbstractControl#get get} instead.
|
||||
*/
|
||||
contains(controlName: string): boolean {
|
||||
return this.controls.hasOwnProperty(controlName) && this.controls[controlName].enabled;
|
||||
|
Reference in New Issue
Block a user