refactor: misc cleanup (#11654)
This commit is contained in:

committed by
Alex Eagle

parent
51d73d3e4e
commit
671f73448c
@ -16,7 +16,6 @@ import {isBlank, isPresent, isStringMap, normalizeBool} from './facade/lang';
|
||||
import {isPromise} from './private_import_core';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Indicates that a FormControl is valid, i.e. that no errors exist in the input value.
|
||||
*/
|
||||
@ -886,7 +885,7 @@ export class FormGroup extends AbstractControl {
|
||||
*/
|
||||
removeControl(name: string): void {
|
||||
if (this.controls[name]) this.controls[name]._registerOnCollectionChange(() => {});
|
||||
StringMapWrapper.delete(this.controls, name);
|
||||
delete (this.controls[name]);
|
||||
this.updateValueAndValidity();
|
||||
this._onCollectionChange();
|
||||
}
|
||||
@ -896,7 +895,7 @@ export class FormGroup extends AbstractControl {
|
||||
*/
|
||||
setControl(name: string, control: AbstractControl): void {
|
||||
if (this.controls[name]) this.controls[name]._registerOnCollectionChange(() => {});
|
||||
StringMapWrapper.delete(this.controls, name);
|
||||
delete (this.controls[name]);
|
||||
if (control) this.registerControl(name, control);
|
||||
this.updateValueAndValidity();
|
||||
this._onCollectionChange();
|
||||
|
Reference in New Issue
Block a user