I'm using AngularJs and I want to create an user in firebase, then I wrote the following code, however it isn't working!
var myApp = angular.module('myApp', ['firebase', 'ngRoute']);
myApp.constant('FIREBASE_URL', 'MY_FIREBASE_URL');
myApp.controller('RegisterController', ['$scope', '$firebaseAuth', 'FIREBASE_URL', function($scope, $firebaseAuth, FIREBASE_URL) {
$scope.headerTitle = "Registration Form";
var ref = new Firebase(FIREBASE_URL);
var auth = $firebaseAuth(ref);
$scope.register = function() {
auth.$createUser({
email: $scope.user.email,
password: $scope.user.password
}).then(function(regUser) {
$scope.message = $scope.user.firstName + " " + $scope.user.lastName + " " + "welcome !";
}).catch(function(error) {
$scope.message = error.message;
});
}
}]);
I get the following error when submit form : Projects created at console.firebase.google.com must use the new Firebase Authentication SDKs available from firebase.google.com/docs/auth/