Hi,
I have the html file in which I am getting the variable as using below statement:
<sly data-sly-test.myVal=${some exp} />
And I want to use myVal in the hbs template under same file like below.
{{#each Obj}}
{{#if myVal == 'bla'}}
<img/>
{{}}
{{/each}}
Thanks,
Solved! Go to Solution.
Views
Replies
Total Likes
I don't think the contexts here are shared. So perhaps what you can do is to write JS-vars, and use these in handlebars?
I don't think the contexts here are shared. So perhaps what you can do is to write JS-vars, and use these in handlebars?
Hi,
You can use the sightly variable in the handlebars by adding @context='scriptString', as shown in the below example
{{#if ${myVal == 'bla' @context='scriptString'}}}
//something
{{/if}}
Views
Replies
Total Likes
This to me looks not like a valid syntax.
Views
Replies
Total Likes
I have tested it. This is working fine for me.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies