<commit_before>function onDeviceReady() {
    angular.bootstrap(document, ["mapal"]);
}
//console.log("binding device ready");
// Registering onDeviceReady callback with deviceready event
document.addEventListener("deviceready", onDeviceReady, false);


// 'mapal.services' is found in services.js
// 'mapal.controllers' is found in controllers.js
angular.module('mapal', ['ionic', 'firebase', 'angularMoment', 'angular-datepicker', 'mapal.controllers', 'mapal.services'])

.run(function ($ionicPlatform, $rootScope, $location, Auth, $ionicLoading, $state) {
    $ionicPlatform.ready(function () {
        console.log("here 1");
        // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
        // for form inputs)
        if (window.cordova && window.cordova.plugins.Keyboard) {
            cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
        }
        if (window.StatusBar) {
            // org.apache.cordova.statusbar required
            StatusBar.styleDefault();
        }
        // To Resolve Bug
        ionic.Platform.fullScreen();
        $rootScope.displayName = null;

        $rootScope.showMyAccount = false;
        $rootScope.showLogout = false;

        // // $rootScope.date = new Date();
        // $rootScope.date = "-";
        // // $rootScope.time = new Date();
        // $rootScope.time = "-";

        $rootScope.dateOptions = {
          format: 'yyyy-mm-dd', // ISO formatted date
          onClose: function(e) {
            // do something when the picker closes 
            console.log("Date: "+e);
          }
        }

        $rootScope.timeOptions = {
          format: 'HH', // ISO formatted date
          onClose: function(e) {
            // do something when the picker closes 
            console.log("Time: "+e);
          }
        }

        Auth.$onAuth(function (authData) {
            if (authData) {
                console.log("Logged in as:", authData.email);
            } else {
                console.log("Logged out");
                $ionicLoading.hide();
                $location.path("common/login");
            }
        });

        $rootScope.logout = function () {
            console.log("Logging out from the app");
            $ionicLoading.show({
                template: 'Logging Out...'
            });
            Auth.$unauth();
            $rootScope.showMyAccount = false;
            $rootScope.showLogout = false;
        }

        $rootScope.aboutUs = function () {
            console.log("Aboutus btn clicked");
            $state.go('aboutUs');<commit_msg>Added a create user function here.<commit_after>function onDeviceReady() {
    angular.bootstrap(document, ["mapal"]);
}
//console.log("binding device ready");
// Registering onDeviceReady callback with deviceready event
document.addEventListener("deviceready", onDeviceReady, false);


// 'mapal.services' is found in services.js
// 'mapal.controllers' is found in controllers.js
angular.module('mapal', ['ionic', 'firebase', 'angularMoment', 'angular-datepicker', 'mapal.controllers', 'mapal.services'])

.run(function ($ionicPlatform, $rootScope, $location, Auth, $ionicLoading, $state) {
    $ionicPlatform.ready(function () {
        console.log("here 1");
        // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
        // for form inputs)
        if (window.cordova && window.cordova.plugins.Keyboard) {
            cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
        }
        if (window.StatusBar) {
            // org.apache.cordova.statusbar required
            StatusBar.styleDefault();
        }
        // To Resolve Bug
        ionic.Platform.fullScreen();
        $rootScope.displayName = null;

        $rootScope.showMyAccount = false;
        $rootScope.showLogout = false;

        // // $rootScope.date = new Date();
        // $rootScope.date = "-";
        // // $rootScope.time = new Date();
        // $rootScope.time = "-";

        $rootScope.dateOptions = {
          format: 'yyyy-mm-dd', // ISO formatted date
          onClose: function(e) {
            // do something when the picker closes 
            console.log("Date: "+e);
          }
        }

        $rootScope.timeOptions = {
          format: 'HH', // ISO formatted date
          onClose: function(e) {
            // do something when the picker closes 
            console.log("Time: "+e);
          }
        }
    
        $scope.createUser = function (user,Role) {
            console.log("Create User Function called");

            if(user.confirmPassword == user.password) {
                if (user && user.emailAddress && user.password && user.fullname && user.contactnumber && user.icnumber) {
                    $ionicLoading.show({
                        template: 'Registering User...'
                    });

                    auth.$createUser({
                        email: user.emailAddress,
                        password: <PASSWORD>
                    }).then(function (userData) {
                        alert("User created successfully!");

                        ref.child("users").child(userData.uid).set({
                            email: user.emailAddress,
                            fullName: user.fullname,
                            contactNumber: user.contactnumber,
                            icNumber: user.icnumber,
                            role: Role.types
                        });
                        
                        $ionicLoading.hide();
                        $scope.registerUserModal.hide();
                    }).catch(function (error) {
                        alert("Error: " + error);
                        $ionicLoading.hide();
                    });
                } else{
                    alert("Please fill all details");
                }
            } else {
                alert("Please make sure your password is the same");
            }
        }  
    
        Auth.$onAuth(function (authData) {
            if (authData) {
                console.log("Logged in as:", authData.email);
            } else {
                console.log("Logged out");
                $ionicLoading.hide();
                $location.path("common/login");
            }
        });

        $rootScope.logout = function () {
            console.log("Logging out from the app");
            $ionicLoading.show({
                template: 'Logging Out...'
            });
            Auth.$unauth();
            $rootScope.showMyAccount = false;
            $rootScope.showLogout = false;
        }

        $rootScope.aboutUs = function () {
            console.log("Aboutus btn clicked");
            $state.go('aboutUs');
{'fraction_non_alphanumeric': 0.12609146070741453, 'fraction_numerical': 0.0002959893443836022, 'mean_word_length': 1.6082593593207255, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '3252008', 'n_tokens_mistral': 1786, 'n_tokens_neox': 1690, 'n_words': 378}