Closed bofoy closed 3 years ago
thanks for reporting.... I'll look into it
hmm, I tried the following:
<a data-foo-bar=${foobar.id}>Link</a>
with:
{
foobar: {
id: 'foo',
},
}
renders as:
<a data-foo-bar="foo">Link</a>
and is compiled as:
$t = $.dom.create("a",false,false);
const var_attrValue0 = foobar["id"];
if (!$.col.empty(var_attrValue0)) {
$.dom.attr($t, 'data-foo-bar', var_attrValue0, 'attribute');
}
$n = $.dom.push($n,$t);
so I don't really know if you're example is correct....
I'm closing this as won't fix. please provide better example.
We have certain data attributes in our HTL in the form of
When compiling the template using
compileToFunction
I got the errorAfter examining the code generated by
compileToString
, I see variables created from the data attributes in the form ofconst var_attrName_data_foo-bar17
. This seems to be causing the issues with thecompileToFunction
. Not sure if I'm missing a config or if there is a workaround for this. Any help would be appreciated!