错误TypeError:无法读取未定义离子的属性“ get”

时间:2019-06-15 12:59:06

标签: typescript ionic-framework

我正在构建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)

0 个答案:

没有答案