<commit_before>'use strict';

angular.module('main')
    .service('mainService', ['$resource',function ($resource) {
        var apiURL = 'http://apiv2.oroszi.net/elvira';
        var api = $resource(apiURL);
        console.dir(api);
        return {
            getMessages: function (params) {
                var get = api.get(params, function (data) {
                    return data;
                });
                return get.$promise;
            }
        };
    }]
);<commit_msg>using  service instaed of<commit_after>'use strict';

angular.module('main')
    .service('MainService', ['$http', 'MainServiceConfig', '$q', '$log',
        function ($http, MainServiceConfig, $q, $log) {

            this.getMessages = function (params) {
                var deferResult = $q.defer();
                $http({
                    method: 'GET',
                    url: MainServiceConfig.apiURL,
                    params: params
                }).success(function (data) {
                    deferResult.resolve(data);
                }).error(function (data, status) {
                    $log.error('Couldn\'t fetch data: '+status);
                    $log.debug(data);
                    deferResult.reject(status);
                });
                return deferResult.promise;
            };
        }]
);
{'fraction_non_alphanumeric': 0.1378012048192771, 'fraction_numerical': 0.0007530120481927711, 'mean_word_length': 1.4748603351955307, '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': '892573', 'n_tokens_mistral': 363, 'n_tokens_neox': 337, 'n_words': 69}