Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
Nível 1
Nível 2
Faça login na Comunidade
Faça logon para exibir todas as medalhas
Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
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,
Solucionado! Ir para a Solução.
Visualizações
respostas
Total de curtidas
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}}
Visualizações
respostas
Total de curtidas
This to me looks not like a valid syntax.
Visualizações
respostas
Total de curtidas
I have tested it. This is working fine for me.
Visualizações
respostas
Total de curtidas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas