8000 custom error messages not showing? · Issue #369 · json-schema-form/angular-schema-form · GitHub
[go: up one dir, main page]

Skip to content
custom error messages not showing? #369
Closed
@plong0

Description

@plong0

I've got a custom form directive with an async validator. The validation is working and setting the field valid/invalid depending on if the validation promise resolves or rejects.

Trouble I am having is with getting the error message to come through. I am using the code:
scope.$broadcast('schemaForm.error.'+ngModel.$name, 'unique', 'That thing is not unique!');

and to clear the error message:
scope.$broadcast('schemaForm.error.'+ngModel.$name, 'unique', true);

is this not the proper way to set the custom error message? I tried setting it in my formDefaults validationMessage, "unique": "That thing is not unique" and that works, but I would prefer to have the message coming from my validator.

unique is the name of the $asyncValidators entry, which doesn't seem to make a difference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0