Reputation: 283
I've got the following tmpl
{{if (${this.getFileLimit()})}}
<div class="files_wrapper">
<div class="add-files">Click to add items</div>
</div>
{{/if}}
And the JS Code:
$('.addFiles').html($("#template").tmpl(data,{
getFileLimit: function(){
if (Object.size(data.items) == 10)
return false;
else
return true;
}
}))
So in general function ${this.getFileLimit()} works (it renders text on screen), but no luck to add it inside IF statement, always get errors.
Uncaught SyntaxError: Unexpected token {
Anyone have and idia how to use functions inside IF?
Upvotes: 0
Views: 1007