问题
I'm trying to use a plugin for OpenSeadragon library in Angular. Plugin is OpenSeadragonSelection. However, it is pure JS and this causes some problems.
I tried to integrate it in my project exactly as described. However, when I try
var selection = viewer.selection(options);
I get the following error:
Property 'selection' does not exist on type 'Viewer'
In the browser console I get:
Uncaught ReferenceError: require is not defined
at openseadragonselection.js:1
Even though I added the script to my angular.json
"scripts": [
"./node_modules/openseadragon/build/openseadragon/openseadragon.min.js",
"./node_modules/openseadragonselection/dist/openseadragonselection.js"
]
Any Ideas how to successfully use the plugin in an Angular project?
来源:https://stackoverflow.com/questions/57906025/using-openseadragon-plugins-in-angular