【发布时间】:2017-06-15 18:51:41
【问题描述】:
我将 dom-to-image 添加到我的 package.json 并在我尝试使用它的文件中,所以我有以下行。
import domtoimage from 'dom-to-image';
我在这一行得到Cannot find module 'dom-to-image',所以我不确定如何导入javascript库。
在我的 node_modules 目录中,我有库。
【问题讨论】:
-
你首先必须在imports中的app.module中注册模块,签名为import {domtoimage} from 'dom-to-imange',然后你就可以使用这个库了
标签: angular typescript import