Angular-Firebase How to store addiotional fields during signup in angular firebase?

Viewed 294

This is my controller for signup, I have successfully signup but I don't know any way to store some additional fields like name, occupation, etc. How can I do that?

controller

app.controller('signupCtrl', function ($http, $scope, toaster, $location, $firebaseAuth) {
var ref = firebase.database().ref();
auth = $firebaseAuth(firebase.auth());

$scope.registerData = {};
$scope.register = function () {

    auth.$createUserWithEmailAndPassword($scope.registerData.email, $scope.registerData.password)
        .then(function (data) {
            $scope.message = "Welcome " + data.uid + ", thanks for registering!";
            console.log(data.uid);
        }).catch(function (error) {
                $scope.message = error.message;
                console.log($scope.message);
            });

    };
});

Do I have to do something in then function or is there already something to handle this ?

2 Answers
Related