<commit_before>angular.module('planifETS.controllers').directive('ionSearchSelect',['$ionicModal', '$ionicGesture', 'CourseService',
  function ($ionicModal, $ionicGesture, CourseService) {
  return {
    restrict: 'E',
    scope: {
      options: "=",
      optionSelected: "="
    },
    controller: function ($scope, $element, $attrs) {
      $scope.searchSelect = {
        title: $attrs.title || "Search",
        keyProperty: $attrs.keyProperty,
        valueProperty: $attrs.valueProperty,
        templateUrl: $attrs.templateUrl || 'templates/searchSelect.html',
        animation: $attrs.animation || 'slide-in-up',
        option: null,
        searchvalue: "",
        enableSearch: $attrs.enableSearch ? $attrs.enableSearch == "true" : true
      };

      $ionicGesture.on('tap', function (e) {

        if(!!$scope.searchSelect.keyProperty && !!$scope.searchSelect.valueProperty){
          if ($scope.optionSelected) {
            $scope.searchSelect.option = $scope.optionSelected[$scope.searchSelect.keyProperty];
          }
        }
        else{
          $scope.searchSelect.option = $scope.optionSelected;
        }
        $scope.OpenModalFromTemplate($scope.searchSelect.templateUrl);
      }, $element);

      $scope.saveOption = function () {
        if(!!$scope.searchSelect.keyProperty && !!$scope.searchSelect.valueProperty){
          for (var i = 0; i < $scope.options.length; i++) {
            var currentOption = $scope.options[i];
            if(currentOption[$scope.searchSelect.keyProperty] == $scope.searchSelect.option){
              $scope.optionSelected = currentOption;
              CourseService.setSelectedCourse(currentOption)
              break;
            }
          }
        }
        else{
          $scope.optionSelected = $scope.searchSelect.option;
        }
        $scope.searchSelect.searchvalue = "";
        $scope.modal.remove();
      };

      $scope.clearSearch = function () {
        $scope.searchSelect.searchvalue = "";<commit_msg>Replaced all "==" with "===" in directive ionSearchSelect<commit_after>angular.module('planifETS.controllers').directive('ionSearchSelect',['$ionicModal', '$ionicGesture', 'CourseService',
  function ($ionicModal, $ionicGesture, CourseService) {
  return {
    restrict: 'E',
    scope: {
      options: "=",
      optionSelected: "="
    },
    controller: function ($scope, $element, $attrs) {
      $scope.searchSelect = {
        title: $attrs.title || "Search",
        keyProperty: $attrs.keyProperty,
        valueProperty: $attrs.valueProperty,
        templateUrl: $attrs.templateUrl || 'templates/searchSelect.html',
        animation: $attrs.animation || 'slide-in-up',
        option: null,
        searchvalue: "",
        enableSearch: $attrs.enableSearch ? $attrs.enableSearch == "true" : true
      };

      $ionicGesture.on('tap', function (e) {

        if(!!$scope.searchSelect.keyProperty && !!$scope.searchSelect.valueProperty){
          if ($scope.optionSelected) {
            $scope.searchSelect.option = $scope.optionSelected[$scope.searchSelect.keyProperty];
          }
        }
        else{
          $scope.searchSelect.option = $scope.optionSelected;
        }
        $scope.OpenModalFromTemplate($scope.searchSelect.templateUrl);
      }, $element);

      $scope.saveOption = function () {
        if(!!$scope.searchSelect.keyProperty && !!$scope.searchSelect.valueProperty){
          for (var i = 0; i < $scope.options.length; i++) {
            var currentOption = $scope.options[i];
            if(currentOption[$scope.searchSelect.keyProperty] === $scope.searchSelect.option){
              $scope.optionSelected = currentOption;
              CourseService.setSelectedCourse(currentOption)
              break;
            }
          }
        }
        else{
          $scope.optionSelected = $scope.searchSelect.option;
        }
        $scope.searchSelect.searchvalue = "";
        $scope.modal.remove();
      };

      $scope.clearSearch = function () {
        $scope.searchSelect.searchvalue = "";
{'fraction_non_alphanumeric': 0.14261041204046385, 'fraction_numerical': 0.0004934616333580064, 'mean_word_length': 2.5069204152249136, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3824886', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1106, 'n_words': 169}