I have the following implementation for the Document Object Model API in Go (simplified example):
type Document struct{
*ui.Element
// list of constructors
Body bodyConstructor
Head headConstructor
Div divConstructor
I have the following implementation for the Document Object Model API in Go (simplified example):
type Document struct{
*ui.Element
// list of constructors
Body bodyConstructor
Head headConstructor
Div divConstructor
ui.New(doc.NewDocument("Todo-App"), | |
Children( | |
E(doc.NewSection("todoapp", "todoapp"), | |
Ref(&AppSection), | |
CSS("todoapp"), | |
Children( | |
E(doc.NewHeader("header", "header"), | |
CSS("header"), | |
Children( | |
E(doc.NewH1("todo", "apptitle").SetText("Todo")), |
ui.New( | |
doc.NewDocument("Todo-App"), | |
NoModifier, | |
E(doc.NewSection("Appsection","todoapp"), | |
NoModifier, | |
E(doc.NewHeader("mainheader","header"), | |
NoModifier, | |
E(doc.NewH1("todo", "apptitle").SetText("Todo"), NoModifier), | |
E(NewTodoInput("todo", "new-todo"), NoModifier), | |
), |
ui.New( | |
doc.NewDocument("Todo-App"), | |
Children( | |
E(doc.NewSection("Appsection","todoapp"), | |
Children( | |
E(doc.NewHeader("mainheader","header"), | |
Children( | |
E(doc.NewH1("todo", "apptitle").SetText("Todo")), | |
E(NewTodoInput("todo", "new-todo")), | |
), |