I created
Handlebars.registerHelper('ifItIsBelow3',function(value){
if (value < 3)
{
return true;
}else
{
return false;
}
});
and wanted to use is on the page
in
{{#ifItIsBelow3 {{@index}}}}
<div>{{artists.0.name}}: {{name}}</div>
<div idName="{{artists.0.name}}: {{name}}" id="{{id}}1" style="background-image:url({{album.images.0.url}})" data-track-id="{{id}}" class="cover"></div>
{{/ifItIsBelow3}}
but my handlebar helper is not working; I have message
Uncaught Error: Parse error on line 3: ... {{#ifItIsZero {{@index}}}}
in browser.
I loaded my handlebarHelper.js as a script on the page. I am not sure if it was really loaded. Should I place it in some very specific place?
all hints are welcome
Marcin