【发布时间】:2018-11-21 08:49:50
【问题描述】:
enter code here
getHospital(term: string = null): Observable<Hospitals[]> {
let items = this.getHospitals1();
if (term) {
items = items.filter(x => x.name.toLocaleLowerCase().indexOf(term.toLocaleLowerCase()) > -1);
}
return items.pipe(delay(500));;
}
getHospitals1() : Observable<Hospitals[]>{
return this.http.get<Hospitals[]>('https://my-json-server.typicode.com/monsterbrain/FakeJsonServer/hospitals')
}
这里我添加过滤器时出错 它是使用 ng-select 的下拉列表的代码。它基于基于文本的搜索 这里我使用 angular7 和 rxjs 6
【问题讨论】:
标签: angular rxjs angular6 rxjs6 angular-ngselect