I have a web application where I add html thats repeated a lot of times via js. This html includes some thymeleaf expressions as th:each[...]
and others.
When I write these right into the html everything is fine and
<div th:if="${bla.start_week == 1}"></div>
evaluates to true, but if i add the same line via js like this:
<script>
ins_bla();
</script>
and
function ins_bla() {
text_part = "<div th:if=\"${bla.start_week == 1}\"></div>"
document.getElementById("blaElem").innerHTML = text_part;
it just adds the line and thymeleaf doesnt seem to do anything. How can I load the data or make sure the line gets executed whatever you gonna call it so that i get back a value? Do I need to pass bla to the js and do the if in js?