【发布时间】:2018-12-13 08:40:40
【问题描述】:
我已经安装了包
npm install local-devices
并将其导入angular.json 为
"scripts": [
"./node_modules/local-devices/index.js"
]
并在src/typings.d.ts中声明为global variable
declare let findLocalDevices: any
下面,package 文件结构和index.js 的local-devices 包
然后尝试在组件中使用它作为
console.log(findLocalDevices())
但出现错误
findLocalDevices 未定义
如何导入,请指导!!!
【问题讨论】:
标签: angular npm import angular6