Knockout.js provides you with great opportunities to write reusable code. Another important task is writing reusable markup. This task can be solved with the help of named templates. It is a very convenient way to create a flexible view. We already discussed one template approach with the control flow bindings (foreach
, if
, and with
). In this section, we will discuss another approach: the string-based templates. They help you connect Knockout.js with third-party templates' engines. The following parameters can be useful in such a case:
As usual, we will learn about the template mechanism with examples.