docs(forms): add diff between add and set control (#42638)

PR Close #42638
This commit is contained in:
David Gilson 2021-06-24 10:36:55 +02:00 committed by atscott
parent f592a12005
commit ad08b17b05
1 changed files with 5 additions and 1 deletions

View File

@ -1457,7 +1457,9 @@ export class FormGroup extends AbstractControl {
/**
* Add a control to this group.
*
* This method also updates the value and validity of the control.
* If a control with a given name already exists, it would *not* be replaced with a new one.
* If you want to replace an existing control, use the {@link FormGroup#setControl setControl}
* method instead. This method also updates the value and validity of the control.
*
* @param name The control name to add to the collection
* @param control Provides the control for the given name
@ -1495,6 +1497,8 @@ export class FormGroup extends AbstractControl {
/**
* Replace an existing control.
*
* If a control with a given name does not exist in this `FormGroup`, it will be added.
*
* @param name The control name to replace in the collection
* @param control Provides the control for the given name
* @param options Specifies whether this FormGroup instance should emit events after an