我的 angular2 应用程序抛出异常,指出Object仅在 Microsoft Edge中不支持此操作。请检查下图:
我调试并发现异常是在承诺然后代码中抛出的。更具体地说,我在下面的代码中收到错误:
this.dataLayerService
.postLogin(this.model, this.postURL)
.then(usermasterResponse => this.setToken(usermasterResponse))
.catch(error => {
this.toastCommunicationService.setMessage(error, "",
this.toastCommunicationService.errorType)
});
我还在 index.html 文件中添加了下面的脚本,但也是徒劳的。
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.1/es6-shim.js"></script>
任何帮助将不胜感激。
问题出在以下代码中的EventSource上:
this.eventsource = new EventSource(this.configService.get("BaseURL"));
我通过添加事件源 Polyfill js 解决了这个问题。我按照这个EventSource Polyfill链接安装了 js。
感谢大家的帮助。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句