【发布时间】:2018-03-29 13:53:55
【问题描述】:
所以我创建了设置当前登录用户的用户名、名字和姓氏的函数,如下所示:
profile = {} as Profile;
...
createProfile() {
this.afAuth.authState.take(1).subscribe(auth => {
this.afDatabase.object(`profile/${auth.uid}`).set(this.profile)
.then(() => this.navCtrl.setRoot(MainPage));
})
}
firebase 上的数据如下所示:
现在,我想在一个名为 user.ts 的新页面中创建新函数:
showdata() { }
因此它将在 user.html 上显示用户的用户名、名字和姓氏
问题是如何做到这一点?
【问题讨论】:
-
我只更改 .ts 和 .html 文件
标签: firebase ionic-framework firebase-realtime-database ionic3