类型'Observable <httpevent <t >>'不可分配给类型'Observable <t>'

时间:2018-12-12 20:32:49

标签: angular6 observable

当我用角度6编写服务时,会出现以下错误。

  

类型'Observable>'不可分配给类型   “可观察”

这是我的服务代码

 constructor(private http: HttpClient, private _configuration: Configuration, private router: Router) {
    this.actionUrl = _configuration.ServerWithApiUrl;
    this._optionBearer = { headers: new HttpHeaders(
      {
        'Content-Type': 'application/json',
        'Authorization': 'Bearer ' + localStorage.getItem('access_token')
      }
    )};

  }

public getList<T>(apiUrl: any): Observable<T> {
    return this.http.get<T>(this.actionUrl + apiUrl, this._optionBearer);
  }

enter image description here

请帮助我解决问题

0 个答案:

没有答案
相关问题