For a twig template file, I want to separate the js content from my HTML content, so I have created a .js file
with this content:
{% if form.vars.data is not null %}
function downloadInvoice() {
window.location = '{{ path('ziiweb_billing_bill', {'id': form.vars.data.id}) }}';
}
{% endif %}
function updateTotals() {
$('#service_download_pdf').css("pointer-events", "none");
$('#service_download_pdf').attr("disabled", "true");
that Im adding using this line:
<script type="text/javascript" src="/bundles/ziiwebbilling/js/service_form.js"></script>
but get this error:
SyntaxError: expected expression, got '%' {% if form.vars.data is not null %}