我想过滤我的数据以仅获取我想要的内容,所以我可以使用它:
这是使用Firebase获取我的用户ID
constructor(private UsersService: UsersService, private NavParams: NavParams, private nav: NavController, private ModalController: ModalController,private afAuth: AngularFireAuth,
private db: AngularFireDatabase,) {
this.afAuth.authState
.subscribe( u => {
this.u = u.uid;
console.log(this.u);
});
}
这就是我的数据库
ngOnInit() {
this.UsersService.read_Students3()。subscribe(data => {
this.utilisateurs = data.map(e => {
return {
id: e.payload.doc.id,
isEdit: false,
nom: e.payload.doc.data()['nom'],
prenom: e.payload.doc.data()['prenom'],
poste: e.payload.doc.data()['poste'],
idproprietaire: e.payload.doc.data()['idproprietaire'],
};
})
console.log(this.utilisateurs);
});
当“ idproprietaire” = this.u(我的用户名)时,我只希望有日期
你有什么主意吗?谢谢