登录到应用程序后,我想将配置文件(前端)数据(用户名和电子邮件)绑定到前端。但这并不奏效。我在这里做错了什么吗?
$scope.login = function() {
fbref.$authWithPassword({
email: $scope.email,
password: $scope.password
}).then(function(authData) {
$scope.userprofile = authData;
$state.go('tabsController.pendingTasks');
})
}

<div ng-controller="loginCtrl" class="card" ng-show="user">
<div class="item item-divider">Username: {{userprofile.email}}
</div>
<div class="item item-text-wrap">
{{userprofile.password.email}}
</div>
</div>
&#13;
答案 0 :(得分:2)
根据文档,成功回调返回一个带有字段uid,provider,auth和expires的对象。在该回调中放置一个断点或将其记录到控制台。
https://www.firebase.com/docs/web/api/firebase/authwithpassword.html
console.log('authData', authData);
答案 1 :(得分:0)
使用cacheProfile工作得很好。例如$ scope.cachedProfile = authData.google.cachedUserProfile; $ scope.cachedProfile.password = $ scope.cachedProfile.uid; $ scope.profileImage = authData.google.profileImageURL;