Search code examples
htmljsonhandlebars.jssendgrid

HandlebarsJS: Hyperlink containing placeholder?


I have the following table with the hyperlink currently not working:

<div class="table">
    <table id="personTable">
        <tbody>
            <tr>
                <th>Id</th>
                <th>Name</th>
            </tr>
            {{#each person}}
            <tr>
                <td><a href="https://www.mywebsite/person/{{id}}">{{id}}</a></td>
                <td>{{name}}</td>
            </tr>
            {{/each}}
        </tbody>
    </table>
</div>

How can I add the placeholder to the end of the Hyperlink so it is added dynamically?


Solution

  • Solutions:

    Try single quote '

    <a href='https://www.mywebsite/person/{{id}}'>{{id}}</a>