【发布时间】:2021-04-13 21:49:53
【问题描述】:
我使用下面的代码只是为了查看连接到 USB 端口的设备。当我在命令提示符下运行“ng serve”命令时,在编译时出现错误“类型导航器上不存在属性 usb”。
ngOnInit() {
async () => {
let devices = await navigator.usb.getDevices();
devices.forEach(device => {
// Add |device| to the UI.
console.log(device);
});
}
}
【问题讨论】:
标签: angular typescript