类型'((error:HttpErrorResponse)=> void'的参数不是 可分配给类型'(err:any,catch: Observable>)=> ObservableInput'。类型 不能将“ void”分配给“ ObservableInput”类型
xls
答案 0 :(得分:0)
请尝试以下操作:
public GetFullAddress(addressModel: FullAddressLookupModel): Promise<AddressModel> {
const promise: Promise<AddressModel> = new Promise<AddressModel>((resolve, reject) => {
this.httpClient.post<AddressModel>(`${this.Domain}api/addressSearch/confirmAddressSelection`, JSON.stringify(addressModel), this.httpOptions ).pipe(
catchError(this.handleError)
)).toPromise().then((response) => {
resolve(response);
}, (err) => {
reject(err);
});
});
return promise;
}