console.log('User ID: ' + user.id + ', Provider: ' + user.provider);
,但是這個人是不是:
$scope.authenticated.currentUser = user.id;
我的目標是採取採取一些認證變量(電子郵件+用戶名)的然後使用它們訪問Firebase上的配置文件節點。在初始化時,我需要用戶名,電子郵件和其他一些我需要的應用程序。
crossfitApp.controller('globalIdCtrl', ["$scope",'defautProfileData','$q', function ($scope,defautProfileData,$q) {
var dataRef = new Firebase("https://glowing-fire-5401.firebaseIO.com");
$scope.authenticated={
currentUser: $scope.authemail,
emailAddress: "",
settings: "",
};
var chatRef = new Firebase('https://<YOUR-FIREBASE>.firebaseio.com');
var auth = new FirebaseSimpleLogin(chatRef, function(error, user) {
if (error) {
// an error occurred while attempting login
switch(error.code) {
case 'INVALID_EMAIL':
case 'INVALID_PASSWORD':
default:
}
} else if (user) {
// user authenticated with Firebase
console.log('User ID: ' + user.id + ', Provider: ' + user.provider);
$scope.authenticated.currentUser = user.id ;//
} else {
// user is logged out
}
});
}]); //GlobaldCtrl
什麼問題:
如果情況確實如此,您都可以向角,它需要$運行使用$超時申請更正此問題?你需要提供一個更清楚解釋什麼是錯的。您的帖子開始於「這不起作用......但這不是。」那麼,這兩個都不行?不工作如何? –
「這個」是指後面的函數,同樣「但這個不是:」代表下一個代碼塊 –
問題不在於你的意思是「這個」。這就是說,你說某件事不起作用,然後按照「但這不是,」這意味着沒有工作。你不會說*如何*不工作,所以不可能告訴你要解決什麼問題。 –