<commit_before>angular.module('controllers', [])

/*
 * GoodDeal CONTROLLER
 */
.controller('goodDealController', function($stateParams, $scope, api){

    var id = $stateParams.id;

    api.goodDealById(id).then(function(result){
        $scope.result = result;
    }, function(result){
        console.log('Error during GoodDeal with ID : '+id+' : '+result);
    });

})

/*
 * Home CONTROLLER
 */
.controller('homeController', function($scope, api, config){

    var page = 1;

    api.goodDealByCategory(config.currentCategory, 1).then(function(result){
        $scope.secondResult = result;
    }, function(result){
        console.log('Error during Home (Second) with CATEGORY : '+config.currentCategory+' : '+result);
    });

    api.goodDealPrimary(config.currentCategory).then(function(result){
        $scope.primaryResult = result;
    }, function(result){
        console.log('Error during Home (Primary) with CATEGORY : '+config.currentCategory+' : '+result);
    });

    $scope.loadMore = function(){
        page++;
        api.goodDealByCategory(config.currentCategory, page).then(function(result){
            $scope.secondResult.push(result);
        }, function(result){
            console.log('Error during Home (Second) with CATEGORY : '+config.currentCategory+' : '+result);
        });
    }

})

/*
 * Overlay CONTROLLER
 */
.controller('overlayController', function($scope, overlay){

    $scope.getOverlay = function () {
        return overlay.get();
    };

    $scope.setOverlay = function (value) {
        overlay.set(value);
    };

})

/*
 * Category CONTROLLER
 */
.controller('categoryController', function($scope, category){

    $scope.getCategory = function () {
        return category.get();
    };

    $scope.setCategory = function (value) {
        category.set(value);
    };

});<commit_msg>Redirect to Home, when we change Category :)<commit_after>angular.module('controllers', [])

/*
 * GoodDeal CONTROLLER
 */
.controller('goodDealController', function($stateParams, $scope, api){

    var id = $stateParams.id;

    api.goodDealById(id).then(function(result){
        $scope.result = result;
    }, function(result){
        console.log('Error during GoodDeal with ID : '+id+' : '+result);
    });

})

/*
 * Home CONTROLLER
 */
.controller('homeController', function($scope, api, config){

    var page = 1;

    api.goodDealByCategory(config.currentCategory, 1).then(function(result){
        $scope.secondResult = result;
    }, function(result){
        console.log('Error during Home (Second) with CATEGORY : '+config.currentCategory+' : '+result);
    });

    api.goodDealPrimary(config.currentCategory).then(function(result){
        $scope.primaryResult = result;
    }, function(result){
        console.log('Error during Home (Primary) with CATEGORY : '+config.currentCategory+' : '+result);
    });

    $scope.loadMore = function(){
        page++;
        api.goodDealByCategory(config.currentCategory, page).then(function(result){
            $scope.secondResult.push(result);
        }, function(result){
            console.log('Error during Home (Second) with CATEGORY : '+config.currentCategory+' : '+result);
        });
    }

})

/*
 * Overlay CONTROLLER
 */
.controller('overlayController', function($scope, overlay){

    $scope.getOverlay = function () {
        return overlay.get();
    };

    $scope.setOverlay = function (value) {
        overlay.set(value);
    };

})

/*
 * Category CONTROLLER
 */
.controller('categoryController', function($scope, $state, category){

    $scope.getCategory = function () {
        return category.get();
    };

    $scope.setCategory = function (value) {
        category.set(value);
        $state.go('app.home');
    };

});
{'fraction_non_alphanumeric': 0.16088580576307365, 'fraction_numerical': 0.0010672358591248667, 'mean_word_length': 3.156319290465632, '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': '2946324', 'n_tokens_mistral': 1145, 'n_tokens_neox': 1102, 'n_words': 201}