I'm writing a web app that's complicated enough that it needs a large family of HTML templates (specifically they're underscore templates, but that part doesn't really matter).
I really want to be able to write template files that look like the following:
fooTemplate:
<div class="foo">
<div class="bar"><%=name %></div>
</div>
And have it turn all of my template files into a single JS file that looks like this:
window.templates = {}
...
templates.fooTemplate = '<div class="foo"><div class="bar">...</div>';
Ideal properties:
Is there anything out there does does any of these things?
You're unlikely to find a comprehensive solution that does everything you list, there will inevitable be "some assembly required" (if not, I'd love to hear about it).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.