knyga / html2thermal

JavaScript library to translate subset of HTML into commands which can be executed on the thermal printer.
MIT License
46 stars 3 forks source link

Printing #3

Closed MarquesCoding closed 2 years ago

MarquesCoding commented 2 years ago

Hi,

So I have a list of members in an Array and want to print that persons name. I itterate through the array and run 'execute(printer, template);' but for some reason it runs through the array and keeps on printing the last one over and over and over...

any ideas?

Thanks

knyga commented 2 years ago

@MarquesCoding It looks like closure issue :) https://stackoverflow.com/questions/750486/javascript-closure-inside-loops-simple-practical-example

Could you share the code, please?