Skip to content

Commit cedc65e

Browse files
committed
Add deep array demo for testing purposes
Update the original array demo when finished
1 parent 449af90 commit cedc65e

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed

examples/data/deep-array.json

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"schema": {
3+
"type": "object",
4+
"title": "Comment",
5+
"required": ["users"],
6+
"properties": {
7+
"users": {
8+
"type": "array",
9+
"items": {
10+
"type": "object",
11+
"properties": {
12+
"name": {
13+
"title": "Name",
14+
"type": "string"
15+
},
16+
"comments": {
17+
"type": "array",
18+
"items": {
19+
"type": "object",
20+
"properties": {
21+
"comment": {
22+
"title": "Comment",
23+
"type": "string",
24+
"maxLength": 20,
25+
"validationMessage": "Don't be greedy!"
26+
},
27+
"tags": {
28+
"title": "Tags",
29+
"type": "array",
30+
"items": {
31+
"type": "object",
32+
"properties": {
33+
"tag": {
34+
"title": "Tag",
35+
"type": "string"
36+
}
37+
}
38+
},
39+
"maxLength": 5
40+
}
41+
},
42+
"required": ["comment"]
43+
}
44+
}
45+
},
46+
"required": ["name"]
47+
}
48+
}
49+
}
50+
},
51+
"form": [
52+
{
53+
"type": "help",
54+
"helpvalue": "<h4>Array Example</h4><p>Try adding a couple of forms, reorder by drag'n'drop.</p>"
55+
},
56+
{
57+
"key": "users",
58+
"add": "New",
59+
"style": {
60+
"add": "btn-success"
61+
},
62+
"items": [
63+
"users[].name",
64+
{
65+
"key": "users[].comments",
66+
"items": [
67+
{
68+
"key": "users[].comments[].comment",
69+
"type": "textarea"
70+
},
71+
{
72+
"key": "users[].comments[].tags",
73+
"items": [
74+
{
75+
"key": "users[].comments[].tags[].tag",
76+
"type": "text"
77+
}
78+
]
79+
}
80+
]
81+
}
82+
]
83+
},
84+
{
85+
"type": "submit",
86+
"style": "btn-info",
87+
"title": "OK"
88+
}
89+
]
90+
}

examples/example.html

+1
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ <h3>Schema</h3>
236236
app.controller('TestCtrl', function($scope, $http, $location) {
237237

238238
$scope.tests = [
239+
{ name: "Deep Array", data: 'data/deep-array.json' },
239240
{ name: "Simple", data: 'data/simple.json' },
240241
{ name: "Basic JSON Schema Type", data: 'data/types.json' },
241242
{ name: "Bootstrap Grid", data: 'data/grid.json' },

0 commit comments

Comments
 (0)