Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs firebase.auth()在登录后使用$scope_Angularjs_Facebook_Firebase_Angularjs Scope_Firebase Authentication - Fatal编程技术网

Angularjs firebase.auth()在登录后使用$scope

Angularjs firebase.auth()在登录后使用$scope,angularjs,facebook,firebase,angularjs-scope,firebase-authentication,Angularjs,Facebook,Firebase,Angularjs Scope,Firebase Authentication,我使用simples ng模型使用angularjs、look my facebookAuthProvider显示登录/内容: $scope.enterFacebook = function() { var auth = firebase.auth(); var provider = new firebase.auth.FacebookAuthProvider(); auth.signInWithPopup(provider).then(functio

我使用simples ng模型使用angularjs、look my facebookAuthProvider显示登录/内容:

   $scope.enterFacebook = function() {
       var auth = firebase.auth();
       var provider = new firebase.auth.FacebookAuthProvider();
     auth.signInWithPopup(provider).then(function(result) {
     console.log('logged.');
     $scope.loggedSystem = true;
     $scope.loginScreen = false;
         }).catch(function(error) {
           var errorCode = error.code;
           var errorMessage = error.message;
           console.log(errorCode+'=>'+errorMessage);
         });
                                     }
我的问题是:

Facebook身份验证工作正常,但$scope.loggedSystem和$scope.loginScreen不能。它仅在我单击两次时有效(ng click='enterFacebook()')


我如何让它只需单击一下就可以工作?

我找到了一个解决方案。只需使用:

$scope.$apply()