<commit_before>function ExerciseController($scope, ExerciseService, exercise, exercises, $state, $filter) {
    var ctrl = this;

    ctrl.things = ['Angular', 'Rails 4.1', 'UI Router', 'Together!!'];
    ctrl.exercises = exercises.data;
    ctrl.exercise = exercise.data;

    ctrl.create = function() {
        ExerciseService.createExercise(ctrl.newExercise)
            .then(function(newExercise) {
                ctrl.exercises.push(newExercise.data);
            });
    };

    ctrl.update = function() {
        ExerciseService.updateExercise(ctrl.exercise)
            .then(function(results) {
                ctrl.exercise = results.data;
            });
        $state.go('exercises');
    };

    ctrl.delete = function(id) {
        ExerciseService.deleteExercise(id);
        $state.reload();
    };

    ctrl.search = '';

    ctrl.refilter = function () {
      ctrl.filteredList = $filter('filter')(ctrl.exercises, ctrl.search);
    };<commit_msg>changed delete function to reload the sate<commit_after>function ExerciseController($scope, ExerciseService, exercise, exercises, $state, $filter) {
    var ctrl = this;

    ctrl.things = ['Angular', 'Rails 4.1', 'UI Router', 'Together!!'];
    ctrl.exercises = exercises.data;
    ctrl.exercise = exercise.data;

    ctrl.create = function() {
        ExerciseService.createExercise(ctrl.newExercise)
            .then(function(newExercise) {
                ctrl.exercises.push(newExercise.data);
            });
    };

    ctrl.update = function() {
        ExerciseService.updateExercise(ctrl.exercise)
            .then(function(results) {
                ctrl.exercise = results.data;
            });
        $state.go('exercises');
    };

    ctrl.delete = function(id) {
        ExerciseService.deleteExercise(id)
        .then(function(){
            $state.reload();
        })

    };

    ctrl.search = '';

    ctrl.refilter = function () {
      ctrl.filteredList = $filter('filter')(ctrl.exercises, ctrl.search);
    };
{'fraction_non_alphanumeric': 0.14171656686626746, 'fraction_numerical': 0.001996007984031936, 'mean_word_length': 2.3925549915397633, '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': '972050', 'n_tokens_mistral': 612, 'n_tokens_neox': 577, 'n_words': 93}