Observable <myresponse>表示什么

时间:2017-07-02 08:38:31

标签: typescript observable

我是打字稿和观察者的新手。我看到了一段代码如下

 getCalulatedValues = (postValue: MyRequest): Observable<MyResponse> => {

        return this._http.post(this.actionUrl, JSON.stringify(postValue), { headers: this.headers })
            .map((response: Response) => <MyResponse>response.json())
            .catch(this.handleError);
  }   

这是什么(postValue:MyRequest):Observable表示什么?我知道postValue属于MyRequest类型,但不理解:的第二部分,即Observable<MyResponse>。整个陈述是什么(postValue: MyRequest): Observable<MyResponse> 意思?

1 个答案:

答案 0 :(得分:-1)

它定义了一个名为getCalulatedValues的函数,它接受名为MyRequest的{​​{1}}类型的参数,并返回postValue类型的值。

相关问题