1
我正在尝试使用Web Midi API构建一个Angular2项目。ng生成错误 - 属性'requestMIDIAccess'不存在
当运行ng build
,我无法完成过程中因抛出一些错误,特别是:
Error in bail mode: [default] /Users/JmsToh/GitHub/web-editor/web-editor/src/app/midi.service.ts:43:22 Property 'requestMIDIAccess' does not exist on type 'Navigator'.
这来自于这部分代码:
if (navigator.requestMIDIAccess) {
this.browserMidiCompatible = true;
navigator.requestMIDIAccess({ sysex: false })
.then(this.onMIDISuccess.bind(this), this.onMIDIReject.bind(this));
} else {
alert("Platform not compatible");
}
的应用程序运行在Chrome上运行得很好ng serve
。有没有什么办法让Angular2在构建时忽略错误?