You are working with the angular-cli?
Netanel Basal
3

It just work if I add the operator in my service.

export function toJSON<T>(this: Observable<Response>): Observable<PostResponseOf<T>>  {
return this.map((res: any) => <PostResponseOf<T>>extractResponseOf(res));
}
Observable.prototype.toJSON = toJSON;