Template string doenst work in edge view

I’m trying to generate a string with js template string, but i got this error:

Invalid or unexpected token

node_modules/edge.js/src/Template/Runner.js

here’s my code:

function generateIssueCard(issueTitle, issuekey) {
  let resp = `
    <div class="card">
      <h2>${issueTitle}</h2>
      <hr/>
      <div hidden id="comments-${issueTitle}">
        <input type="text" placeholder="Add a comment" id="add-comment" />
        <input type="button" value="Add" onclick="addComment()" />
      </div>
      <button onclick="showComments('${issueTitle}', '${issuekey}')">Get comment</button>
    </div>
  `

  return resp;
}
1 Like

function generateIssueCard(issueTitle, issuekey) {
  let resp = `
    <div class="card">
      <h2>{{issueTitle}}</h2>
      <hr/>
      <div hidden id="comments-{{issueTitle}}">
        <input type="text" placeholder="Add a comment" id="add-comment" />
        <input type="button" value="Add" onclick="addComment()" />
      </div>
      <button onclick="showComments({{issueTitle}},{{issuekey}})">Get comment</button>
    </div>
  `

  return resp;
}
2 Likes