'Headers' 与类型 'RequestOptionsArgs' 没有共同的属性

'Headers' has no properties in common with type 'RequestOptionsArgs'

我将 angular 库升级到 4.3.6,将 tslint 升级到 5.7.0,但在构建 angular 应用程序时出现以下错误。

我没有在下面的代码中使用 RequestOptionsArgs,但出现以下错误

错误

Type 'Headers' has no properties in common with type 'RequestOptionsArgs'.

我的angular服务码如下

import { Injectable } from '@angular/core';
import {Summary} from './summary';
import {Http, Headers, Response} from '@angular/http';
import { Observable } from 'rxjs/Observable';
import {SelectItem} from "primeng/primeng";
import {ExceptionHandle} from "../util/exceptionhandle";
import {MYCONST} from "../util/constants";

@Injectable()
export class MyService {

  private myUrl= MYCONST.reconURL.url;
  private headers: Headers = new Headers({"Content-Type'" : 'application/json',
                            'Accept': 'application/json',
                            'Access-Control-Allow-Origin':'*',
                            'Access-Control-Allow-Credentials':'true'
  });

  getSummaries(): Observable<Summary[]> {
    return this.http.get(this.reconUrl + '/summaries', this.headers)
      .map((response: Response) => <Summary[]> response.json())
      .catch(this.handleError);
  }

  private handleError(error: any): Promise<any> {
    return ExceptionHandle.handleError(error);
  }

}

您在错误的地方传递了 headers 参数。您应该在 http.get 方法

中将 headers 作为 RequestOptionsArgs 对象的 属性 传递
return this.http.get(this.reconUrl + '/summaries', { headers: this.headers })