fix global namespace polution with invalidWidgets

This commit is contained in:
Igor Minar 2010-10-12 14:14:39 +08:00 committed by Misko Hevery
parent 70ff7a2639
commit 451a711343

View file

@ -38,7 +38,7 @@ function valueAccessor(scope, element) {
requiredExpr = element.attr('ng:required'),
formatterName = element.attr('ng:format') || NOOP,
formatter = angularFormatter(formatterName),
format, parse, lastError, required;
format, parse, lastError, required,
invalidWidgets = scope.$invalidWidgets || {markValid:noop, markInvalid:noop};
if (!validator) throw "Validator named '" + validatorName + "' not found.";
if (!formatter) throw "Formatter named '" + formatterName + "' not found.";