symfony - handlebars template can't fill with data -


i need output data , fill template throught custum function

this imports

<script src="{{ asset('bundles/.../handlebars/handlebars.js') }}"></script> <script src="{{ asset('bundles/.../handlebars_helpers.js') }}"></script> 

this template twig page

<script id="di_template" type="text/x-handlebars-template">     {% verbatim %}         <h1>title </h1>         invoice {{ invoice.invoice_number }}     {% endverbatim  %} </script> 

this build template function

function buildtemplate(){      context = {         invoice: {             invoice_number: 'val1',             invoice_date: 'val2',             invoice_due_date: 'val3',             invoice_from_company: 'val4'         }     };      template = $('#di_template').html();     template_compiled = handlebars.compile(template);     thecompiledhtml = template_compiled(context);     $invoice_preview.html(thecompiledhtml);  } 

this result enter image description here


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -