だから私はrequireAuth()
fromを使ってを使ってfirebase
Web アプリを開発しています。私は3つのことにまったく慣れていません。メソッドは私のアプリでうまく機能し、オンラインで検索していますが、出くわしましたが、まだ違いがわかりません。名前からして、認証を待ちますが(もちろん待ちますよね?)。を使用するのが理想的な場合と、 を使用するのが理想的な場合です。gulpJs
angularJs
Firebase
requireAuth()
$waitForAuth()
requireAuth()
$waitForAuth()
requireAuth()
myApp.factory('Authentification', function($firebase, $firebaseObject, $firebaseAuth, $routeParams, $location, FIREBASE_URL){
//not posting the other parts of the code since they are not needed in this case
var ref = new Firebase(FIREBASE_URL);
var auth = $firebaseAuth(ref);
var mytempObj = {
requireAuth: function() {
return auth.$requireAuth();
},
waitAuth: function(){
return auth.$waitForAuth();
}//wait for user to be authenticated
}
return mytempObj;
}