R
R
Rocknglory2014-08-05 19:56:10
JavaScript
Rocknglory, 2014-08-05 19:56:10

How to make multiple handlebars templates for one window?

Good afternoon, it is necessary to solve the following problem.

Write a function that displays a modal window.
Load certain data of a certain type into this window.

I have quite a lot of such windows with different purposes and I would like to implement the function once, and then put the required layout into the html container of the window and load the data. Is it possible to implement multiple templates with calls to the right one for each specific situation using handlebars? That is, first put the template in .html, and then compile it with the necessary data.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Kureev, 2014-08-07
@Rocknglory

Nothing prevents you from first compiling the template with all the data you need, and only then adding such a window to the DOM. This can be done using handlebars or any other templating engine.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question