-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.js
50 lines (35 loc) · 869 Bytes
/
example.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
/* TO-DO APP example */
App.name = "Todo List";
var home = new el('view');
// {
// home: {
// container:{
// segment:{
// list:{
// listItem:{}
// },
// button:{
// }
// }
// }
// }
// }
var container = new el('container',{class:['text']});
var segment = new el('segment',{class:[]});
var list = new el('List',{class:['relaxed','divided']});
var listItem = new el('item',{content: {header:"Task1", description: "Fix bugs in phpninja.info"}});
list.append(listItem);
var button = new el('button',{content: "Add To-do"},
{
click: function(){
var item = new el('item',{content:{header:"Task2", description: "Appended"}});
list.append(item);
}
});
var table = new el('table');
segment.append(list);
segment.append(button);
container.append(segment);
home.append(container)
App.views.push(home);
App.init();