public getPayerTypes(): Observable<PayerType[]> {
return this.http.get<PayerTypes>('getPayerTypes')
.pipe(
pluck('data'),
catchError(this.handleError)
);
}
private httpGet<T, K>(url: string): Observable<T> {
return this.http.get<PayerTypes>('getPayerTypes')
.pipe(
pluck('data'),
catchError(this.handleError)
);
}
Observable<PayerTypes>
. Другим он быть не может и ни от чего не зависит. Зачем там url
?type Urls = {
getPayerTypes: PayerTypes;
getNPCTypes: NPCTypes;
}
private httpGet<K extends keyof Urls>(url: K): Observable<Urls[K]> {
return this.http.get<Urls[K]>(url)
.pipe(
pluck('data'),
catchError(this.handleError)
);
}