1
我想創建包含用戶ID的firebase參考。這裏是我的代碼:Firebase SimpleAuth以諾言返回null
var authref = new Firebase('https://myfunnyapp.firebaseio.com');
$scope.auth = $firebaseSimpleLogin(authref);
$scope.auth.$getCurrentUser().then(function(user) {
var ref = new Firebase('https://myfunnyapp.firebaseio.com/events/' + user.id);
$scope.events = $firebase(ref);
});
我使用承諾回調來解析用戶,當它被認證。
這個工作正常刷新,當我已經登錄。但在auth。$ login()調用用戶等於空。
您的$ login()代碼在哪裏?在$ login的承諾中返回什麼,catch/finally塊怎麼樣?控制檯中出現什麼錯誤? – Kato
$ login()是標準身份驗證$ login(auth從$ firebaseSimpleLogin返回 – GintsGints
)您需要詳細回答這些問題才能獲得幫助;我們需要能夠驗證並重現問題以確定什麼你需要去解決它。 – Kato