ngx-schema-form icon indicating copy to clipboard operation
ngx-schema-form copied to clipboard

How custom error message and i18n?

Open vellengs opened this issue 8 years ago • 3 comments

Does it exist any way to custom error message for required.

        "properties": {
            "contact": {
                "title": "name",
                "type": "string",
                "widget": "input",
                "maxLength": 16,
                "required":"please input the name "   //is it possible like this?
            }

vellengs avatar Oct 18 '17 08:10 vellengs

not for now, but should be quite easy to fix

ebrehault avatar Oct 18 '17 14:10 ebrehault

Hi, I'm new to this project and was just playing around and hit the same issue. Does the form generator display validation errors out-of-the-box (irrespective of I18n)? I noticed that widget.ts has some code related to errorMessages, but none of the default widgets seem to be using it anywhere:

https://github.com/makinacorpus/angular2-schema-form/blob/c46cd13e8e7f412aa35cc64bee0547c18cb66406/src/widget.ts#L8-L31

saurabhnanda avatar Nov 28 '17 13:11 saurabhnanda

There is nothing out-of-the-box to display error messages, but you can override the default widgets and display errors the way you want.

ebrehault avatar Nov 28 '17 15:11 ebrehault