<commit_before>angular
  .module('app')
  .controller('featureEditController', [
    '$scope',
    '$location',
    '$routeParams',
    'userService',
    'featureService',
    'actionKitService',
    '$rootScope',
    function($scope, $location, $routeParams, userAPI, Feature, actionKitService, $rootScope) {
        $scope.feature = Feature.get({id: $routeParams.id}, function(feature) {
            return feature;
        });

        $scope.update = function() {
            $scope.feature.$update(function(response) {
                alert("Feature updated successfully");
                $location.path('/admin/features');
            });
        };
    }]);<commit_msg>Update Edit Feature Form to use FormHelper service. Add validations and alerts.<commit_after>angular
  .module('app')
  .controller('featureEditController', [
    '$scope',
    '$location',
    '$routeParams',
    'userService',
    'featureService',
    'actionKitService',
    'FormHelper',
    '$rootScope',
    function($scope, $location, $routeParams, userAPI, Feature, actionKitService, FormHelper, $rootScope) {
        $scope.feature = Feature.get({id: $routeParams.id}, function(feature) {
            return feature;
        });

        $scope.showError = FormHelper.showError;
        $scope.showSuccess = FormHelper.showSuccess;

        $scope.update = function() {
            // FormHelper.update(form, model, callback)
            FormHelper.update($scope.EditFeatureForm, $scope.feature, function() {
                alert("Feature updated successfully");
                $location.path('/admin/features');
            });
        };
    }]);
{'fraction_non_alphanumeric': 0.14652014652014653, 'fraction_numerical': 0.0, 'mean_word_length': 2.618101545253863, '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': '1457016', 'n_tokens_mistral': 439, 'n_tokens_neox': 430, 'n_words': 82}