This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //universal Create Element function | |
| function createElement(type, props, ...children) { | |
| let dom = document.createElement(type); | |
| if (props) Object.assign(dom, props); | |
| for (let child of children) { | |
| if (typeof child != "string" && typeof child != "number") | |
| dom.appendChild(child); | |
| else dom.appendChild(document.createTextNode(child)); | |
| } | |
| return dom; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1. Variable mit Closure Syntax und Klasse "groovy.lang.Closure" erstellen oder Inhalt direkt in ein Textfeld einfügen z.B.: $V{testClosure}. | |
| // Variable kann dann in einem Textfeld eingefügt und die Closure mit $V{testClosure}() aufgerufen werden. | |
| { | |
| def a = 3; | |
| def b = 4; | |
| def c = a + b; | |
| return c; | |
| } | |
| // 2. Beispiel mit Parameter. |
OlderNewer