Firebase不推薦使用FirebaseSimpleLogin,因此我們一直試圖實施新的authWithOAuthPopup,但我們不斷收到控制檯錯誤:TypeError:undefined不是函數。Firebase Google登錄
var app = angular.module("myApp", ["firebase"]);
app.controller("appCtrl", function($scope, $firebase) {
var ref = new Firebase("https://[forge].firebaseio.com/users");
// Login using Google
$scope.loginGoogle = function() {
console.log("Got into google login");
ref.authWithOAuthPopup("google", function(error, authData) {
console.log("yeah, we got in! " + user.uid);
}, {
remember: "sessionOnly",
scope: "email"
});
};
$scope.logout = function() {
ref.unauth();
};
});
我在做什麼錯?