【发布时间】:2019-03-24 15:37:07
【问题描述】:
嗨,在我的 nativescript angular 应用程序中,我在应用程序启动时检查用户是否登录并相应地调用函数。代码如下:
ngOnInit() {
firebase.init({
onAuthStateChanged: function (data) {
if (data.loggedIn) {
this.navigateToHome();
}
},
})
错误:
Firebase AuthStateListener failed to trigger function (data) {
if (data.loggedIn) {
this.navigateToHome();
...<omitted>... } TypeError: Cannot read property 'navigateToHome' of undefined
【问题讨论】:
标签: angular typescript firebase firebase-authentication