我在Angular 5应用程序中使用此服务方法:
createDateUserConnection(calendarEventUserConnection: CalendarEventUserConnection): Observable<any> {
let creationIndex: number = 0;
let url: string = environment.apiEndpoint + 'calendareventuserconnections/calendareventuserconnection/' + calendarEventUserConnection.calendarEvent.id + '/' + creationIndex;
return this.http.post(url, calendarEventUserConnection, this.options);
}
我想将此方法的返回类型从Observable<any>
转换为Observable<CalendarEventUserConnection>
。有没有办法以简单的方式做到这一点?