0

Is it possible to move templates to separate files in jsBlocks? On their website there is only an example with embedded template.

RobertPorter
  • 542
  • 6
  • 16

1 Answers1

1

Yes. Absolutely. You just have to reference the file using a script tag and provide a custom type so the browser don't interpret it as a JavaScript file.

<script src="myTemplate.bt" type="blocks/template"></script>

myTemplate.bt

<div class="template">{{name}}</div>
astoilkov
  • 556
  • 1
  • 5
  • 14