Angular schema form default not picking up -


we using angular-schema-from redring form json schema , json from

some how not getting default value enum,

please refer below form , schema...

schema json:

{     "type": "object",     "title": "comment",     "properties": {         "contactdetails": {             "title": "contact person",             "type": "array",             "minitems": 1,             "items": {                 "type": "object",                 "properties": {                     "contacttype": {                         "title": "contact type",                         "description": "select",                         "type": "string",                         "default": "test",                         "enum": ["test", "test1"]                     }                 }             }         }     } } 

form json:

[     "contactdetails[].contacttype",     {         "type": "submit",         "style": "btn-info",         "title": "ok"     } ] 

it's because of array in combo form definition, can't access field inside array without wrapping in a array type.

try form definition instead:

[     {         "type": "array",         "key": "contactdetails",         "items": [             "contactdetails[].contacttype"         ]     },     {         "type": "submit",         "style": "btn-info",         "title": "ok"     } ] 

example: http://schemaform.io/examples/bootstrap-example.html#/c0cf38b387b84e567176


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -