Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
2 Respostas
10554 Visualizações

Please help me here

this is in my template

<t t-set=”abcd” t-value=”my_function()” /> 
<t t-esc="abcd"/>

this is my java script

<script>
function my_function(){
var msg= 'Hello';
return msg;
}
</script>


Avatar
Cancelar
Melhor resposta

<t t-set="count" t-value="window.my_function()" />

if you want to pass other function which is not availabe at window global object then pass it as args like

$(QWeb.render('my_tempalte', {my_function: widget.my_function}));
it will call by <t t-set="abcd" t-value="my_function()" />


Avatar
Cancelar
Melhor resposta

do you solv this problem? 


Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
2
ago. 22
11203
2
mai. 21
8048
2
fev. 19
9697
0
jul. 18
3378
0
jun. 24
643