Answer the question
In order to leave comments, you need to log in
JS: how to make template re-render?
Now I use underscore templates (lodash) for rendering, the
data is rendered both on the client and on the server (single page)
there is a rather large amount of static data that never changes
and it makes no sense to re-render them. Moreover, how to re-transfer to a template on the server
it makes no sense to transfer such a template + data to the client for client-side
rendering rendering through nodejs
the question is how to implement it? How to render the template so that the placeholders I need to render the changing data remain as a result?
The option of substituting placeholders instead of data does not work - lodash replaces them immediately.
So far I see such options:
1. in the already rendered template (after the first pass and substitution of unchanged data) using replace replacement, for example grunt-string-replace , insert lodash tags
2. use two different template engines with different syntax, for example lodash and handlebars, but the disadvantages are obvious,
what other options can there be? what did i miss?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question