<commit_before>angular.module('$selectBox', [])
    .directive('selectBox', function() {
        return {
            restrict: 'E',
            require: ['ngModel', 'ngData','ngSelectedId','ngSelectedValue','?ngTitle','ngiItemName','ngItemId'],
            template: '<input id="showed" type="text" ng-click="showSelectModal()" readonly/>' +
            '<span id="hidden" type="text" style="display: none;"></span>',
            controller: ($scope, $element, $attrs, $ionicModal, $parse) => {
                $scope.modal = {};

                $scope.showSelectModal = function() {
                    var val = $parse($attrs.ngData);
                    $scope.data = val($scope);
                    
                    $scope.modal.show();
                }

       		 $scope.closeSelectModal = function() {
                    $scope.modal.hide();
                };

                $scope.$on('$destroy', function(id) {
                    $scope.modal.remove();
                });

                //{{'Gift.modalTitle' | translate}} 
                $scope.modal = $ionicModal.fromTemplate(
                    '<div class="modal" id="select">' +
                    '<ion-header-bar>' +
                    '<h1 class="title">' + $attrs.ngTitle + '</h1>' +
                    ' <a ng-click="closeSelectModal()" class="button button-icon icon ion-close"></a>' +
                    '</ion-header-bar>' +
                    '<ion-content>' +
                    '<ul class="list">' +
                    '<li class="item" ng-click="clickItem(item)" ng-repeat="item in data" ng-bind-html="item[\''+ $attrs.ngItemName +'\']"></li>' +
                    '</ul>' +
                    ' </ion-content>' +
                    '</div>',
                    {
                        scope: $scope,
                        animation: 'slide-in-right'
                    });

                $scope.clickItem = function(item) {
                    var index = $parse($attrs.ngSelectedId);
                    index.assign($scope.$parent, item[$attrs.ngItemId]);

                    var value = $parse($attrs.ngSelectedValue);
                    value.assign($scope.$parent, item[$attrs.ngItemName]);

                    $scope.closeSelectModal();
                };
            },
            compile: ($element, $attrs) => {


                var input = $element.find('input');
                angular.forEach({
                    'name': $attrs.name,
                    'placeholder': $attrs.ngPlaceholder,
                    'ng-model': $attrs.ngSelectedValue
                },<commit_msg>optimizations<commit_after>angular.module('$selectBox', [])
    .directive('selectBox', function() {
        return {
            restrict: 'E',
            require: ['ngModel', 'ngData','ngSelectedId','ngSelectedValue','?ngTitle','ngiItemName','ngItemId'],
            template: '<input id="showed" type="text" ng-click="showSelectModal()" style="cursor:inherit;" readonly />' +
            '<span id="hidden" type="text" style="display: none;"></span>',
            controller: ($scope, $element, $attrs, $ionicModal, $parse) => {
                $scope.modal = {};

                $scope.showSelectModal = function() {
                    var val = $parse($attrs.ngData);
                    $scope.data = val($scope);
                    
                    $scope.modal.show();
                }

       		 $scope.closeSelectModal = function() {
                    $scope.modal.hide();
                };

                $scope.$on('$destroy', function(id) {
                    $scope.modal.remove();
                });

                //{{'Gift.modalTitle' | translate}} 
                $scope.modal = $ionicModal.fromTemplate(
                    '<ion-modal-view id="select">' +
                    '<ion-header-bar>' +
                    '<h1 class="title">' + $attrs.ngTitle + '</h1>' +
                    ' <a ng-click="closeSelectModal()" class="button button-icon icon ion-close"></a>' +
                    '</ion-header-bar>' +
                    '<ion-content>' +
                    '<ul class="list">' +
                    '<li class="item" ng-click="clickItem(item)" ng-repeat="item in data" ng-bind-html="item[\''+ $attrs.ngItemName +'\']"></li>' +
                    '</ul>' +
                    ' </ion-content>' +
                    '</ion-modal-view>',
                    {
                        scope: $scope,
                        animation: 'slide-in-right'
                    });

                $scope.clickItem = function(item) {
                    var index = $parse($attrs.ngSelectedId);
                    index.assign($scope.$parent, item[$attrs.ngItemId]);

                    var value = $parse($attrs.ngSelectedValue);
                    value.assign($scope.$parent, item[$attrs.ngItemName]);

                    $scope.closeSelectModal();
                };
            },
            compile: ($element, $attrs) => {


                var input = $element.find('input');
                angular.forEach({
                    'name': $attrs.name,
                    'placeholder': $attrs.ngPlaceholder,
                    'ng-model': $attrs.ngSelectedValue
                },
{'fraction_non_alphanumeric': 0.16263568844029708, 'fraction_numerical': 0.0007617596648257475, 'mean_word_length': 1.3238938053097344, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 41, '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': '573096', 'n_tokens_mistral': 1396, 'n_tokens_neox': 1309, 'n_words': 210}