0

I am trying to use the modulus operator with jquery templates but get a syntax error

Uncaught SyntaxError: Unexpected token { 

{{if Items.length > 0}}
    <div>
        <table class='table table-bordered' style='width:450px;'>
            <thead style='text-align:center;'>
            <td>
                <strong>Related Topics</strong>
            </td>
            </thead>
            {{each Items}}
             {{if ${$index} % 6===0}}
                <td>
                        <input type='hidden' name='subUniqueKey${DomainObjectUniqueKey}' value='${DomainObjectUniqueKey}' />
                        <input type='checkbox' name='chkTopics${DomainObjectUniqueKey}'/><label id='labRelTopicsDisplay${DomainObjectUniqueKey}'>${subject}</label>  
                </td>
             {{/if}}
        {{/each}}
      </table>
    </div>
{{/if}}

Advice perhaps as to where the error lies

thanks

1 Answer 1

1

I think this is the part causing error

{{if ${$index} % 6===0}}

Try to change it to

{{if $index % 6===0}}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.