角度2不在Mozilla Firefox中工作,但在chrome中工作

时间:2017-08-02 17:54:54

标签: javascript angular

我的应用程序在chrome中完美运行但在Mozilla firefox中加载应用程序时,它在控制台中的服务调用时抱怨以下内容............任何帮助都将受到高度赞赏

EXCEPTION: Uncaught (in promise): TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
subscribeToResult@http://localhost:4200/vendor.bundle.js:42454:27
["../../../../rxjs/operator/catch.js"]/CatchSubscriber.prototype.error@http://localhost:4200/vendor.bundle.js:30613:22
["../../../../rxjs/Subscriber.js"]/Subscriber.prototype._error@http://localhost:4200/vendor.bundle.js:23676:9
["../../../../rxjs/Subscriber.js"]/Subscriber.prototype.error@http://localhost:4200/vendor.bundle.js:23650:13
XHRConnection/this.response</onError@http://localhost:4200/vendor.bundle.js:111302:17
["../../../../zone.js/dist/zone.js"]/</</ZoneDelegate.prototype.invokeTask@http://localhost:4200/polyfills.bundle.js:6063:17
["../../../core/src/zone/ng_zone.js"]/NgZone.prototype.forkInnerZoneWithAngularBehavior/this.inner<.onInvokeTask@http://localhost:4200/vendor.bundle.js:102996:28
["../../../../zone.js/dist/zone.js"]/</</ZoneDelegate.prototype.invokeTask@http://localhost:4200/polyfills.bundle.js:6062:17
["../../../../zone.js/dist/zone.js"]/</</Zone.prototype.runTask@http://localhost:4200/polyfills.bundle.js:5862:28
ZoneTask/this.invoke@http://localhost:4200/polyfills.bundle.js:6116:28

以下是我用来调用服务的代码。此调用在Chrome / IE中完全正常

headers = new Headers();
  constructor(private http:Http) {
    this.headers.append('content-type', 'application/json');
    this.headers.append('Accept', 'q=0.8;application/json;q=0.9');
  }
  getFundingRequestData() {
    return this.http.get(this.Url).map((res:Response) => res.json()).catch((err:any) => err);
  }

0 个答案:

没有答案