-
Notifications
You must be signed in to change notification settings - Fork 0
/
mvc-example.html
55 lines (49 loc) · 1.05 KB
/
mvc-example.html
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
<!DOCTYPE html>
<html>
<head>
<title>Sample App</title>
<script src="src/lib/curl.js"></script>
<script>
var config = {
baseUrl: "src",
paths: {
"curl": "lib/curl.js",
},
preloads: [
"src/lib/polyfills"
]
};
curl(config, [
"lib/jquery",
"lib/jquery-nohtml",
"ui/stack/stack",
"ui/card/card",
"ui/button/button",
"ui/abstractwidget/abstractwidget",
"ui/fields/textfield",
"lib/model",
"link!app.css" ]
).then(function( $, create, Stack, Card, Button, AbstractWidget, TextField, Model ) {
var App = AbstractWidget.extend({
init: function() {
var stack = new Stack({ parent: "body" });
var model = window.model = new Model({
data: {
value1: "oh yeh!"
}
});
stack.push(new Card({
title: "Field Test",
children: [
new TextField({ id: "test", model: model, modelField: "value1" }),
new Button({ id: "button", label: "Validate" })
]
}));
}
});
new App({});
});
</script>
</head>
<body></body>
</html>