Template to string

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Template to string

I'm currently using the thymeleaf to create handlebars templates on the page like so:

  <script id="dashboardTemplate" type="x-handlebars-template"> <template th:substituteby="thymeleaf/dashboardTemp"></template> </script>

That works however I need to have the handlebars scripts inside a standalone script file like templates.js which doesn't allow xml/html and needs to be a string like so:

Handlebars.registerPartial("dashboardTemplate", <template th:substituteby="thymeleaf/dashboardTemp"></template>);

Where the tag would output a very long string. How would one do this?