我试图从像这样的简单函数中返回一个observable
public saveSurvey =(surveyId: number, surveyResponse: SurveyResponse) : Observable<Response> => {
return this.http.post(this.config.api.survey + surveyId +'/answers', surveyResponse)
.map((res: Response) => res);
};
但我的IDE(WebStorm)正在报告
Returned expression type OperatorFunction<R,T> is not assignable to type Observable<Response>
据我所知,所有示例都显示此模式工作正常,Http.get确实返回一个Observable。