Skip to content

Commit ce6cf7c

Browse files
committed
Filter out "parse" error.
We always get one since we use $parsers to hook up our validation. Fixes json-schema-form#397
1 parent 75be503 commit ce6cf7c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/directives/message.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@ angular.module('schemaForm').directive('sfMessage',
2525
(scope.ngModel && scope.ngModel.$error) || {}
2626
);
2727

28+
// Since we use $parsers to hook up our validation we also end up with a "parse" error.
29+
// so we remove it.
30+
errors = errors.filter(function(e) { return e !== 'parse'; });
31+
2832
// We only show one error.
2933
// TODO: Make that optional
3034
var error = errors[0];
31-
3235
if (error) {
3336
element.html(sfErrorMessage.interpolate(
3437
error,

0 commit comments

Comments
 (0)