refactor(facade): remove useless facades

This commit is contained in:
Victor Berchet
2016-09-18 15:39:26 -07:00
committed by Rado Kirov
parent 34b31dea7c
commit 58605cf350
24 changed files with 91 additions and 159 deletions

View File

@ -43,10 +43,8 @@ export class FormBuilder {
*/
group(controlsConfig: {[key: string]: any}, extra: {[key: string]: any} = null): FormGroup {
const controls = this._reduceControls(controlsConfig);
const validator: ValidatorFn =
isPresent(extra) ? StringMapWrapper.get(extra, 'validator') : null;
const asyncValidator: AsyncValidatorFn =
isPresent(extra) ? StringMapWrapper.get(extra, 'asyncValidator') : null;
const validator: ValidatorFn = isPresent(extra) ? extra['validator'] : null;
const asyncValidator: AsyncValidatorFn = isPresent(extra) ? extra['asyncValidator'] : null;
return new FormGroup(controls, validator, asyncValidator);
}
/**

View File

@ -492,7 +492,7 @@ export abstract class AbstractControl {
getError(errorCode: string, path: string[] = null): any {
var control = isPresent(path) && !ListWrapper.isEmpty(path) ? this.get(path) : this;
if (isPresent(control) && isPresent(control._errors)) {
return StringMapWrapper.get(control._errors, errorCode);
return control._errors[errorCode];
} else {
return null;
}