问题
This is encoder package file encoder
Am using that package in my angular (ionic) project like this.. which is working fine..
let items: string[] = ['Apple', 'Orange', 'Banana'];
let EscPosEncoder = require('esc-pos-encoder');
let encoder = new EscPosEncoder();
let result = encoder
.initialize()
.text(' test text')
.newline()
.encode();
The above code is working fine.. Now i need to add items details.
My code ts file :
let result = encoder
.initialize()
.text('The quick brown fox jumps over the lazy dog')
.newline()
items.forEach(function (value) {
.text((value) ---below 2 lines are dynamically add
.newline()
}) ---- how to dynamically add items?
.encode();
How to dynamically append( string builder) in typescipt?please any suggest?Is it possibe with typescript//
来源:https://stackoverflow.com/questions/65228046/add-text-from-array-of-strings-to-in-string-in-angular