S
S
Sergey Kochetkov2015-01-13 11:59:14
JavaScript
Sergey Kochetkov, 2015-01-13 11:59:14

What Requirejs templating engine do you use and why?

I'm doing my first project with requirejs.
There was a question of a template engine choice.
It is necessary to be able to use both templates built in by the optimizer and dynamically loaded. The template contains as little non-HTML code as possible.
For example, we pass an object - 1 object is rendered, we pass an array of objects - all are rendered. The template does not require changes and does not contain loop statements.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Pavel Elizariev, 2015-01-13
@legatdestr

I'm using a bunch of RequireJs , Durandal and KnockOut .
Regarding working with templates, RequireJs itself with the text module allows you to load text templates. Gulp allows you to optimize the loading of RequireJs modules and templates into a single file. Knockout allows you to implement not only template rendering, but also data binding. And Durandal allows you to well structure the code into modules.
In this assembly, the use of third-party template engines seems redundant to me.

A
Alexander, 2015-01-13
@Wunderbar

Underscore templates

K
Konstantin Kitmanov, 2015-01-13
@k12th

I gave up trying to implement this - far from all templating engines have wrappers for AMD, not everyone can compile on the client side, etc., of what is, half is outdated and abandoned, the other half is some kind of mustache-type hipstotrash.
I do either this: all templates are built into the page, compiled and cached on the first call, or all in Jade, grunt collects them into an AMD-compatible file, which is connected.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question