<commit_before>angular.module('citizen-engagement.newIssueCtrl', [])

.controller('addIssue', function($scope, $ionicLoading, $state, $http, apiUrl) {

    $scope.issue = {};

    console.log('On est dans le addIssue controller');
 $scope.register = function() {
    console.log('On est dans le scope register');
      // Forget the previous error (if any).
      delete $scope.error;

      // Show a loading message if the request takes too long.
      $ionicLoading.show({
        template: 'Adding issue...',
        delay: 750
      });

      // Make the request to retrieve or create the issue.
      $http({
        method: 'POST',
        url: apiUrl + '/issues/',
        data: $scope.issue
      }).success(function(issue) {
        console.log('C est un succès !');
        //test affichage id issue
        $scope.issues = issue;

        console.log(issue.id);
        
        // Hide the loading message.
        $ionicLoading.hide();

        // Go to the issue creation tab.
        $state.go('tab.issueList');

      }).error(function() {
        console.log('bon....ça ne marche pas');
        // If an error occurs, hide the loading message and show an error message.
        $ionicLoading.hide();
        $scope.error = 'Could upload the issue';
      });
    };
})

.controller('IssueTypesListCtrl', function ($scope, $http, apiUrl) {
        $scope.loadIssueTypes = function () {
            $http.get(apiUrl + '/issueTypes').success(function (issueTypes) {
                $scope.issueTypes = issueTypes;
                console.log(issueTypes);

                index = 0;

                while (index < issueTypes.length)
                {
                    console.log(issueTypes[index].name);
                    $scope.currentIssueType = issueTypes[index].name;
                    index++;
                }
                
                console.log("test injection map");
                
                
                console.log("Fin code test injection map");
            });
        };
    $scope.loadIssueTypes();
})

.controller("takePicture", function($scope, CameraService, $http, qimgUrl, qimgToken) {<commit_msg>newIssueCtrl modifications<commit_after>angular.module('citizen-engagement.newIssueCtrl', [])

.controller('addIssue', function($scope, $ionicLoading, $state, $http, apiUrl) {

    $scope.issue = {};

    console.log('On est dans le addIssue controller');
 $scope.register = function() {
    console.log('On est dans le scope register');
      // Forget the previous error (if any).
      delete $scope.error;

      // Show a loading message if the request takes too long.
      $ionicLoading.show({
        template: 'Adding issue...',
        delay: 750
      });

      // Make the request to retrieve or create the issue.
      $http({
        method: 'POST',
        url: apiUrl + '/issues/',
        data: $scope.issue
      }).success(function(issue) {
        console.log('C est un succès !');
        //test affichage id issue
        $scope.issues = issue;

        console.log(issue.id);
        
        // Hide the loading message.
        $ionicLoading.hide();

        // Go to the issue creation tab.
        //$state.go('tab.issueList');

      }).error(function() {
        console.log('bon....ça ne marche pas');
        // If an error occurs, hide the loading message and show an error message.
        $ionicLoading.hide();
        $scope.error = 'Could upload the issue';
      });
    };
})

.controller('IssueTypesListCtrl', function ($scope, $http, apiUrl) {
        $scope.loadIssueTypes = function () {
            $http.get(apiUrl + '/issueTypes').success(function (issueTypes) {
                $scope.issueTypes = issueTypes;

                index = 0;

                while (index < issueTypes.length)
                {
                    //console.log(issueTypes[index].name);
                    $scope.currentIssueType = issueTypes[index].name;
                    index++;
                }
            });
        };
    $scope.loadIssueTypes();
})

.controller("takePicture", function($scope, CameraService, $http, qimgUrl, qimgToken) {
{'fraction_non_alphanumeric': 0.13429951690821257, 'fraction_numerical': 0.001932367149758454, 'mean_word_length': 1.8857142857142857, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3182832', 'n_tokens_mistral': 1163, 'n_tokens_neox': 1088, 'n_words': 288}