【发布时间】:2019-01-20 03:09:21
【问题描述】:
我正在尝试构建一个预先输入的查询。我现在拥有的是返回一个空字符串。我是使用 firebase 的新手,所以不确定我做错了什么。
list(searchString, path) {
const list: AngularFireList<IdNamePair> = this.fireBase.list(path, ref => ref
.orderByChild('name')
.startAt(searchString)
.endAt('\uf8ff')
);
return list;
}
getUsersTypeAhead(searchString: string) {
return this.list(searchString, '/users').snapshotChanges().pipe(
map(items => items.map(item => ({
id: item.key,
...item.payload.val()
})))
);
}
【问题讨论】:
标签: javascript angular firebase firebase-realtime-database