Ich habe eine for:each
wie folgt aus:Get Objekt thymelaf
<tbody>
<tr th:each="bill : ${bills}" id="bill">
<td th:text="${bill.bill_id}"></td>
<td th:text="${bill.client.phone}"></td>
<td th:text="${bill.date}"></td>
<td><a href="#" class="btn btn-info btn-xs" data-toggle="modal"
id="open-modal">Ver detalles</a></td>
</tr>
</tbody>
Die Frage ist, wie kann ich die gesamte ${bill}
einer Variablen in JavaScript oder jQuery bekommen, weil ich mehr Informationen benötigen. Ich sah die Dokumentation und es hieß:
<script th:inline="javascript">
/*<![CDATA[*/
...
var user name = /*[[${bill}]]*/ '';
...
/*]]>*/
</script>
Ich habe dies auf einer externen JavaScript-Datei versucht und es funktioniert nicht.