Closed offtopic closed 7 years ago
Yes, that is by design.
JsViews does smart data-binding, so that when you observably change data, the rendered content is updated incrementally, rather than removing all the previously rendered content and reapplying the whole template.
In your example if you write {^{for ui.colGroups}}...
then you can observably add or remove colGroup items and JsViews will insert or remove the rendered HTML just for the added/removed item, without touching the rest of the content.
The $.view()
API (http://www.jsviews.com/#jsv.d.view) lets you get from an HTML element to the relevant data, etc.
These features are made possible by JsViews tracking the 'mapping' between data-linked data and the HTML, and the empty script tags is one of the ways it achieves that. They are used as 'markers' - and have no effect on the HTML rendering.
See also https://github.com/BorisMoore/jsviews/issues/362
@offtopic - didn't hear back from you in response, but I'll close this, as answered.
Partial Template:
Resulting Code:
Is the usage correct, are they empty script tags by design? Are there any performance issues with so much empty script tags?
Thank's, offtopic