fix(forms): getError does not work without path

This commit is contained in:
vsavkin
2015-06-09 16:05:13 -07:00
parent cee26826d7
commit a858f6ac42
2 changed files with 3 additions and 1 deletions

View File

@ -123,7 +123,7 @@ export class AbstractControl {
find(path: List<string | number>| string): AbstractControl { return _find(this, path); }
getError(errorCode: string, path: List<string> = null) {
var c = this.find(path);
var c = isPresent(path) && !ListWrapper.isEmpty(path) ? this.find(path) : this;
if (isPresent(c) && isPresent(c._errors)) {
return StringMapWrapper.get(c._errors, errorCode);
} else {