<tmplx>
Build state-driven web app with Go in HTML.
<script type="text/tmplx">
// name is a state
var name string = "tmplx"
// greeting is a derived
var greeting string = fmt.Sprintf("Hello ,%s!", name)
var counter int = 0
// addOne event handler
func addOne() {
counter++
}
</script>
<h2> { greeting } </h2>
<button tx-onclick="addOne()">Add 1</button>
<p>count: { counter }</p>
<p>count * 10 = { counter * 10 }</p>
Hello ,tmplx!
count: 0
count * 10 = 0