我真的想将 SimpleLogin 身份验证与 Angular js 的解析集成。我尝试执行以下操作:
app.config(function($routeProvider) {
$routeProvider.when("/login", {
templateUrl: "templates/authentication.html",
controller: "AuthenticationController",
resolve: {
authenticated_user: function($q, $timeout) {
var deferred = $q.defer();
var ref = new Firebase("https://theuy-angularfire.firebaseio.com/");
var auth = new FirebaseSimpleLogin(ref, function(error, user) {
if (error) {
deferred.resolve(null);
} else if (user) {
console.log('User ID: ' + user.id + ', Provider: ' + user.provider);
deferred.resolve(user);
} else {
deferred.resolve(null);
}
});
return deferred.promise;
}
}
});
当我成功登录但我的模板未呈现时,我收到了回调。你能给我一个建议如何使用 Firebase SimpleLogin 身份验证和解析吗?