Hi, i have a backend service that I wrote in Golang, something like this:
func PageA_RequestHandler(ctx *W.Context) {
// init things
if is_ajax {
// handle the API request, render the JSON
return
}
// query the initial rows
values := M.SX{
`rows`: model1.GetRows(10),
}
// render the html
ctx.Render(`page_a_template`,values)
}
then the template file `page_a_template.html` (that loaded at the first
time it rendered), is a html file, with content something like this:
<div id="grid"></div>
<script>
var rows = {/* rows */};
new GridBuilder('grid',rows);
</script>
Where's:
{/* rows */} is my javascript-friendly template syntax, there are some
other syntax like: [/* foo */] or /*! bar */ or #{yay}
new GridBuilder is my custom javascript component that creates something
like datatables.net or editablegrid.net
The question is, if I use Elm, what's the correct way to inject the {/*
rows */} into the compiled html?
--
You received this message because you are subscribed to the Google Groups "Elm
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.