угловой отклик наблюдения в динамически создаваемом HttpRequest - PullRequest
0 голосов
/ 28 декабря 2018

Попытка прикрепить {observe: 'response'} в правильном месте

 testRequest() {
    // let req = new HttpRequest(this.api.method, this.requestUrl)
    let req = new HttpRequest(this.api.method, this.requestUrl, {}, {
      observe: 'response' // <------ Type Error
    });

    if (this.api.method === METHOD.POST || this.api.method === METHOD.PUT) {
      req = req.clone({body: this.request.body});
    }
    req = req.clone({observe: 'response'}); // <---- No Go
    this.http.request(req).subscribe(result => {
      this.response = result;
    }, error => {
      this.response = error;
    });
  }

Может кто-нибудь поделиться примером, пожалуйста?

...