-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
94 lines (87 loc) · 2.62 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*global angular */
"use strict";
/**
* The main app module
* @name testApp
* @type {angular.Module}
*/
var testApp = angular.module('app', ['ngRoute', 'ngSanitize', 'schemaForm'])
.config(function($routeProvider) {
$routeProvider.
when('/', {controller: 'appController'});
});
testApp.controller('appController', ['$scope', '$http', function ($scope, $http) {
$scope.schema = {
type: "object",
title: "Tokenfield",
properties: {
nummer: {
type: "number",
minimum: 3,
maximum: 5
},
tokenfield1: {
title: "Tokenfield",
type: "array",
format: "tokenfield",
items: {
type: 'number',
minimum: 3,
maximum: 5
}
},
tokenfield2: {
title: "Tokenfield",
type: "array",
format: "tokenfield",
items: {
type: 'object',
properties: {
age: {
minimum: 3,
maximum: 5
}
}
}
},
arraytest: {
title: "Array",
type: "array",
items: {
type: "number",
maximum: 5
}
}
}
};
$scope.form = [
// "nummer",
{
key: "tokenfield1",
},
//"tokenfield2",
"arraytest",
// {
// description: "This is a simple field with minimum length 5",
// key: "minlength",
// minLength: 5
// },
{
key: "autocomplete",
autocomplete: {
source: ['red', 'blue', 'green', 'yellow', 'violet', 'brown', 'purple', 'black', 'white'],
delay: 100
},
showAutocompleteOnFocus: true,
placeholder: "Autocomplete requires jquery-ui"
},
{
type: 'submit',
title: 'Submit'
}
];
$scope.model = {};
$scope.submit = function(tokenfieldForm) {
console.log("Form submitted!")
}
}]);