小编jms*_*toh的帖子

ng 构建错误 - 属性“requestMIDIAc​​cess”不存在

我正在尝试使用 Web Midi API 构建一个 Angular2 项目。

运行时ng build,由于抛出了某些错误,我无法完成该过程,特别是:

保释模式错误:[默认] /Users/JmsToh/GitHub/web-editor/web-editor/src/app/midi.service.ts:43:22 
“导航器”类型上不存在属性“requestMIDIAc​​cess”。

这来自这部分代码:

if (navigator.requestMIDIAccess) {
  this.browserMidiCompatible = true;
  navigator.requestMIDIAccess({ sysex: false })
    .then(this.onMIDISuccess.bind(this), this.onMIDIReject.bind(this));
} else {
  alert("Platform not compatible");
}
Run Code Online (Sandbox Code Playgroud)

运行时该应用程序在 Chrome 上运行良好ng serve。有没有办法让 Angular2 在构建时忽略错误?

angular

3
推荐指数
1
解决办法
1070
查看次数

标签 统计

angular ×1