<commit_before>angular.module('foodGenerator')
    .controller("RegisterCtrl", function ($scope, $uibModalInstance) {
        $scope.errorText = '';

        $scope.register = register;
        $scope.cancel = cancel;

        function register() {
            console.log("Performing registration with email '" + $scope.email + "' and password '" + $scope.password + "'.");
            // var currUser = {};
            // currUser.register($scope.username, $scope.password).then(function () {
            //     $uibModalInstance.close();
            // }, function (response) {
            //     debugger;
            //     if (response.status == 400 || response.status == 401) {
            //         $scope.errorText = "An unknown error occured. Please try again later.";
            //     }
            // });
        }

        function cancel() {
            $uibModalInstance.dismiss('cancel');
        }
    });<commit_msg>finished implementation of register controller<commit_after>angular.module('foodGenerator')
    .controller("RegisterCtrl", function ($scope, currentUser, $uibModalInstance) {
        $scope.errorText = '';

        $scope.register = register;
        $scope.cancel = cancel;

        function register() {
            currentUser.register($scope.email, $scope.password, $scope.firstName, $scope.lastName)
                .then(function () {
                    $uibModalInstance.close();
                    // returned token is automatically saved by auth-interceptor
                }, function (error) {
                    if (error.status == 400 || error.status == 401) {
                        $scope.errorText = "An unknown error occured. Please try again later.";
                    }
                });
        }

        function cancel() {
            $uibModalInstance.dismiss('cancel');
        }
    });
{'fraction_non_alphanumeric': 0.13455328310010764, 'fraction_numerical': 0.006458557588805167, 'mean_word_length': 1.7338235294117648, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1364336', 'n_tokens_mistral': 472, 'n_tokens_neox': 445, 'n_words': 94}