Hi I was trying to create angular library that at behind was using one of javascript package (bwip-js) https://www.npmjs.com/package/bwip-js.
The problem is idk how to use bwip-js in library as normally in angular app I will just add js file into angular.json => scripts section:
"scripts": [ "./node_modules/bwip-js/dist/bwip-js-min.js"]
And then in component import it:
import bwipjs from 'bwip-js';
and use:
renderBarcode(value: string): void { const canvas = this.barcode?.nativeElement; if (canvas) { bwipjs.toCanvas(canvas, { bcid: this.type, text: value, scale: this.scale, rotate: this.rotate, includetext: this.includetext, textxalign: 'center' }); }
}