我正在尝试使用 Web Midi API 构建一个 Angular2 项目。
运行时ng build,由于抛出了某些错误,我无法完成该过程,特别是:
保释模式错误:[默认] /Users/JmsToh/GitHub/web-editor/web-editor/src/app/midi.service.ts:43:22 “导航器”类型上不存在属性“requestMIDIAccess”。
这来自这部分代码:
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 ×1