json-schema-form / angular-schema-form

Generate forms from a JSON schema, with AngularJS!
https://json-schema-form.github.io/angular-schema-form
MIT License
2.47k stars 653 forks source link

Add support for function instead of string in name/description field … #755

Closed fookoo closed 7 years ago

fookoo commented 8 years ago

Description

Add support for function instead of string in schema object.

You can now use

let schema = {
        type: "object",
        properties: {
                name: {
                    type: "string",
                    minLength: 2,
                    title: () => $filter('translate')("Name"),
                    description: () => $filter('translate')("Description")
                },
                title: {
                    type: "string",
                    enum: ['dr','jr','sir','mrs','mr','NaN','dj']
                }
            };

Fixes Related issues

754

Checklist

Anthropic commented 8 years ago

@fookoo thanks for the PR, can you see a way we could apply the solution to the form instead of the schema? schema-form is a standard we do not control and can't really make changes to while remaining compliant.

I love the approach and can see the need for it, but to be accepted it needs to be applied via the form javascript instead which is optional also.

Anthropic commented 7 years ago

Closing due to lack of response, i18n has alternative suggestions for handling such as #865