我正在构建ionic 5应用程序,并创建一个页面以保留使用Firebase的用户个人资料。然后我从ts文件中得到了此消息(我相信)。请帮助我指出在哪里可以解决此问题,非常感谢。
profile.page.ts
ngOnInit() {
this.profileService
.getUserProfile()
.get()
.then( userProfileSnapshot => {
this.userProfile = userProfileSnapshot.data();
this.birthDate = userProfileSnapshot.data().birthDate;
});
}
ProfilePage_Host.ngfactory.js? [sm]:1 ERROR TypeError: Cannot read property 'get' of undefined
at ProfilePage.push../src/app/pages/profile/profile.page.ts.ProfilePage.ngOnInit (profile.page.ts:23)
at checkAndUpdateDirectiveInline (core.js:22099)
at checkAndUpdateNodeInline (core.js:23363)
at checkAndUpdateNode (core.js:23325)
at debugCheckAndUpdateNode (core.js:23959)
at debugCheckDirectivesFn (core.js:23919)
at Object.eval [as updateDirectives] (ProfilePage_Host.ngfactory.js? [sm]:1)
at Object.debugUpdateDirectives [as updateDirectives] (core.js:23911)
at checkAndUpdateView (core.js:23307)
at callViewAction (core.js:23548)