将Interact.js与Angular项目集成 [英] Integrating Interact.js with an Angular Project

查看:118
本文介绍了将Interact.js与Angular项目集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在Angular项目中使用Interact.js提供的功能,例如可拖动,可调整大小等,但是我找不到在打字稿中导入它的可靠方法.

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.

推荐答案

Interactjs团队添加了类型定义,因此可以与typescript一起使用.使用NPM 安装,而不是像

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';

这篇关于将Interact.js与Angular项目集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆