<commit_before>mod = angular.module('tagInputWrapper', ['ngTagsInput']);

/*
 * Wrap the <tags-input> tag and link it to a hidden field, so the
 * tags can be initialized and send back as an ordinary form field
 */
mod.directive('inputwrap', function($rootScope, $http) {
    return {
        restrict: 'E',
        transclude: true,
        scope: {
            flat_tags: '@value'
        },
        controller: function($scope, $element, $attrs) {
            if($scope.flat_tags) {
                $scope.tags = $scope.flat_tags.split(",");
            }
            else {
                $scope.tags = [];
            }

            $scope.loadTags = function(query) {
                return $http.get($rootScope.urlbase + '+tags/?query=' + query);
            };

            $scope.$watch(function() { return $scope.tags; },
                function(newVal, oldVal) {
                    var res = [];
                    var i = 0;
                    for(i = 0; i < newVal.length; i++) {
                        res.push(newVal[i].text);
                    }
                    $scope.flat_tags = res.join();
            }, true);
        },
        template: '<tags-input ng-model="tags">' +
        '<auto-complete source="loadTags($query)"></auto-complete>' +
        '</tags-input>' +
        '<input type="hidden" name="tags" value="<[flat_tags]>">'
    };
});

<commit_msg>fix tags: <[ ]> no longer angular placeholder tags<commit_after>mod = angular.module('tagInputWrapper', ['ngTagsInput']);

/*
 * Wrap the <tags-input> tag and link it to a hidden field, so the
 * tags can be initialized and send back as an ordinary form field
 */
mod.directive('inputwrap', function($rootScope, $http) {
    return {
        restrict: 'E',
        transclude: true,
        scope: {
            flat_tags: '@value'
        },
        controller: function($scope, $element, $attrs) {
            if($scope.flat_tags) {
                $scope.tags = $scope.flat_tags.split(",");
            }
            else {
                $scope.tags = [];
            }

            $scope.loadTags = function(query) {
                return $http.get($rootScope.urlbase + '+tags/?query=' + query);
            };

            $scope.$watch(function() { return $scope.tags; },
                function(newVal, oldVal) {
                    var res = [];
                    var i = 0;
                    for(i = 0; i < newVal.length; i++) {
                        res.push(newVal[i].text);
                    }
                    $scope.flat_tags = res.join();
            }, true);
        },
        template: '<tags-input ng-model="tags">' +
        '<auto-complete source="loadTags($query)"></auto-complete>' +
        '</tags-input>' +
        '<input type="hidden" name="tags" value="{{flat_tags}}">'
    };
});


{'fraction_non_alphanumeric': 0.15643845335225257, 'fraction_numerical': 0.001418942887548776, 'mean_word_length': 1.5800548947849955, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 17, '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': '6806872', 'n_tokens_mistral': 809, 'n_tokens_neox': 784, 'n_words': 172}