Angular 角度2/4-在没有返回值的情况下管理响应?

Angular 角度2/4-在没有返回值的情况下管理响应?,angular,angular-http,Angular,Angular Http,请告诉我 有些查询没有返回值,但有状态代码。我想基于此代码发布消息。该函数起作用,但不进入showNotification方法 ...... let params = new URLSearchParams(); params.set('token', token); this.http.get(CaSettings.API_HOME_LOGOUT, new RequestOptions({params: params, headers: this.getHeaders

请告诉我

有些查询没有返回值,但有状态代码。我想基于此代码发布消息。该函数起作用,但不进入showNotification方法

......

let params = new URLSearchParams();
      params.set('token', token);
      this.http.get(CaSettings.API_HOME_LOGOUT, new RequestOptions({params: params, headers: this.getHeaders()}))
.map(this.showNotification)
.subscribe();
}

......

  showNotification(res: Response) {
    if (res.status == 200) {
      this.notification.success("success", "success")
    }
  }

谢谢。

map(this.showNotification)
更改为
map(res=>this.showNotification(res))
并将console.log添加到showNotification方法中。如果控制台日志未显示,则表示请求失败。它正常工作。问题已经解决,谢谢!这意味着正在调用showNotification,但它抛出了一个错误。你应该在控制台中找到那个错误。是的,我理解。我处于调试模式。我有一个全局错误处理。