[英]AngularJS / Firebase - Need to login twice for a successful login
I have simple AngularJS app and using Firebase OpenAuth for user authentication. 我有简单的AngularJS应用,并使用Firebase OpenAuth进行用户身份验证。 Here is a sample code from plunkr.
这是来自plunkr的示例代码。
[http://plnkr.co/edit/ZVfkaJF0g3E5u63J7uHx?p=preview][1]
I have to click twice to authData from Google. 我必须单击两次以从Google进行authData。 I don't understand, why I can't get the data on the first click.
我不明白,为什么我第一次点击就无法获得数据。
You need to apply digest
cycle after receiving an event. 您需要在收到事件后应用
digest
周期。
$rootScope.$auth.$onAuth(function(authData){
$rootScope.authData = authData;
$scope.$apply();
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.