我正在处理一个observable并且收到此错误"无法调用其类型缺少调用签名的表达式。键入' String'没有兼容的呼叫签名。这是被调用的方法:
accountTypeAhead(param, url = this.accountAutoComplete): Observable <any> {
let params = new HttpParams();
params = params.set('prefix', param);
return this.http.get(url, {params: params}).map((res: Response) => res.json());
}
然后我在组件中收到错误:
dataSource: Observable<any>;
this.dataSource = Observable.create((observer: any) => {
this.users.accountAutoComplete(this.userForm.value.prefix).subscribe((result: any) => {
observer.next(result.payload);
});
});