Integrating Interact.js with an Angular Project

吃可爱长大的小学妹 提交于 2020-01-13 09:11:29

问题


I need to use the functionality provided by Interact.js, such as draggable, resizable and such, in an Angular project, but i can't find a solid way of importing it in typescript.

I've read about some work-arounds by defining it as a function, but i just want to know if that's the proper way to do it.


回答1:


Interactjs team added type definition so you can use with typescript. Use NPM install instead of separate file like

npm install interactjs

Then the regular import should work

import * as interact from 'interactjs';


来源:https://stackoverflow.com/questions/48703625/integrating-interact-js-with-an-angular-project

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