4

How to write if condition in below script

<script id="some-template" type="text/x-magento-template">
    <div class="wrapper">
if(data.id == 10) {
        <input id="<%- data.id %>" name="<%- data.name %>" placeholder="<%- data.placeholder %>" />
}
    </div>
</script>

1 Answer 1

5
<script id="some-template" type="text/x-magento-template">
    <div class="wrapper">
    <% if (data.id == 10) { %>
        <input id="<%- data.id %>" name="<%- data.name %>" placeholder="<%- data.placeholder %>" />
    <% } %>
    </div>
</script>
3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.