<script >
document.write("<table border=2 width=50%");
for (var i = 0; i < ${SALE_DATA.SALE_ORDER_ITEMS_LIST.length}; i++) {
document.write("<tr>");
document.write("<td>" + ${SALE_DATA.SALE_ORDER_ITEMS_LIST[i].WEIGHT} + "</td>");
document.write("<td>" + i + "</td>");
document.write("</tr>");
}
document.write("</table>");
</script>
I am trying to pass the i in ${SALE_DATA.SALE_ORDER_ITEMS_LIST[i].WEIGHT}
here SALE_DATA is the constant array in angular 5.
but it is giving the error like below
ERROR ReferenceError: i is not defined. suggest me the way to pass the i value in loop
if i keep the ${SALE_DATA.SALE_ORDER_ITEMS_LIST[0].WEIGHT}
the output is like below
thanks in advance!! out put
${}outside of a template string? You should getUncaught SyntaxError: Unexpected token {as an error