refactor: misc cleanup (#11654)

This commit is contained in:
Victor Berchet
2016-09-19 17:15:57 -07:00
committed by Alex Eagle
parent 51d73d3e4e
commit 671f73448c
37 changed files with 112 additions and 196 deletions

View File

@ -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();