Using OpenSeadragon Plugins in Angular

你离开我真会死。 提交于 2020-01-06 05:33:05

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!