<commit_before>angular
  .module('app')
  .controller('featureNewController', [
    '$scope',
    '$location',
    '$routeParams',
    'userService',
    'featureService',
    'actionKitService',
    '$rootScope',
    function($scope, $location, $routeParams, userAPI, Feature, actionKitService, $rootScope) {
        $scope.feature = new Feature();

        $scope.create = function() {
            $scope.feature.$save(function() {
                $location.path('/admin/features/' + $scope.feature.id + "/edit");
                alert("Feature saved successfully!");
            });
        };
    }]);<commit_msg>Update New Feature form to use the Form Helper. Add validations and alerts.<commit_after>angular
  .module('app')
  .controller('featureNewController', [
    '$scope',
    '$location',
    '$routeParams',
    'userService',
    'featureService',
    'actionKitService',
    'FormHelper',
    '$rootScope',
    function($scope, $location, $routeParams, userAPI, Feature, actionKitService, FormHelper, $rootScope) {
        $scope.feature = new Feature();

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

        $scope.create = function() {
            // FormHelper.create(form, model, callback)
            FormHelper.create($scope.NewFeatureForm, $scope.feature, function() {
                $location.path('/admin/features/' + $scope.feature.id + "/edit");
                alert("Feature saved successfully!");
            });
        };

    }]);
{'fraction_non_alphanumeric': 0.15505913272010513, 'fraction_numerical': 0.0, 'mean_word_length': 2.6522781774580335, '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': '6197263', 'n_tokens_mistral': 417, 'n_tokens_neox': 407, 'n_words': 81}