if (this.sampleArr.length === 0) {
this.afs.collection('users', ref => ref.where('displayName', '==', firstLetter))
.snapshotChanges().subscribe(data => {
data.forEach(childData => {
const uid = childData.payload.doc.data();
const isMember = ((this.groupInfo.superUser.includes(uid.uid))
|| (this.groupInfo.administrators.includes(uid.uid))
|| (this.groupInfo.members.includes(uid.uid)));
console.log('ismember', isMember);
if (!isMember) {
this.sampleArr.push(childData.payload.doc.data());
}
console.log('this.sampleArr', this.sampleArr);
});
});
}
我有一个聊天应用程序,它限制了已经属于组的用户的添加。问题在于它抱怨有效载荷childData.payload.doc.data()上的.uid。尽管它可以在离子服务中使用,但由于该问题我无法制造:
uid显示在console.log中,但我无法编译。
任何帮助将不胜感激。