1
試圖在angularfire2中獲取currentUser。什麼類型公開這個?在'firebaseAuthState'類型上不存在屬性'currentUser'
https://firebase.google.com/docs/reference/js/firebase.auth.Auth
這不是明顯,我去探索這個觀察到:
constructor(private auth: FirebaseAuth) {
auth.subscribe((user) => console.log('user is', user));
}
感謝。缺少的是updateProfile方法。但是,我也沒有在auth_backend.ts源文件中看到它。 https://firebase.google.com/docs/auth/web/manage-users#update_a_users_profile – okhobb
我想這就是答案。應該GOOGLE更好。 https://github.com/angular/angularfire2/issues/281 – okhobb
'user.auth'屬性是'User'實例,所以它有'updateProfile'方法。也就是說,你可以調用'user.auth.updateProfile(...)'。如果您正在查看控制檯中的'user.auth',那麼'updateProfile'方法可能並不明顯,因爲它在原型中。 – cartant