-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
The json schema form
tabarray example can not be reproduced.
To reproduce:
- clone the repository
npm i
ng serve
Onapp-component.html
:
<json-schema-form
[schema]="exampleSchema"
[form]="form"
(onSubmit)="exampleOnSubmitFn($event)">
</json-schema-form>
on app-component.ts
:
exampleSchema = {
"type": "object",
"title": "Comment",
"properties": {
"comments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"email": {
"title": "Email",
"type": "string",
"pattern": "^\\S+@\\S+$",
"description": "Email will be used for evil."
},
"comment": {
"title": "Comment",
"type": "string",
"maxLength": 20,
"validationMessage": "Don't be greedy!"
}
},
"required": [ "name", "email", "comment" ]
}
}
}
};
form = [ {
"type": "help",
"helpvalue": "<h4>Tabbed Array Example</h4><p>Tab arrays can have tabs to the left, top or right.</p>"
}, {
"key": "comments",
"type": "tabarray",
"add": "New",
"remove": "Delete",
"style": { "remove": "btn-danger" },
"title": "{{ value.name || 'Tab ' + $index }}",
"items": [
"comments[].name",
"comments[].email",
{ "key": "comments[].comment", "type": "textarea" }
]
}, {
"type": "submit",
"style": "btn-default",
"title": "OK"
} ];
Any idea?
Metadata
Metadata
Assignees
Labels
No labels