whole_func_string: function selectedItemChange (selectedItem, previousSelectedItem) {
  
      updateModelValidators();
  
      if (selectedItem) {
        getDisplayValue(selectedItem).then(function (val) {
          $scope.searchText = val;
          handleSelectedItemChange(selectedItem, previousSelectedItem);
        });
      } else if (previousSelectedItem && $scope.searchText) {
        getDisplayValue(previousSelectedItem).then(function(displayValue) {
          // Clear the searchText, when the selectedItem is set to null.
          // Do not clear the searchText, when the searchText isn't matching with the previous
          // selected item.
          if (angular.isString($scope.searchText)
            && displayValue.toString().toLowerCase() === $scope.searchText.toLowerCase()) {
            $scope.searchText = '';
          }
        });
      }
  
      if (selectedItem !== previousSelectedItem) announceItemChange();
    }
func_code_string: function selectedItemChange (selectedItem, previousSelectedItem) {
  
      updateModelValidators();
  
      if (selectedItem) {
        getDisplayValue(selectedItem).then(function (val) {
          $scope.searchText = val;
          handleSelectedItemChange(selectedItem, previousSelectedItem);
        });
      } else if (previousSelectedItem && $scope.searchText) {
        getDisplayValue(previousSelectedItem).then(function(displayValue) {
          // Clear the searchText, when the selectedItem is set to null.
          // Do not clear the searchText, when the searchText isn't matching with the previous
          // selected item.
          if (angular.isString($scope.searchText)
            && displayValue.toString().toLowerCase() === $scope.searchText.toLowerCase()) {
            $scope.searchText = '';
          }
        });
      }
  
      if (selectedItem !== previousSelectedItem) announceItemChange();
    }
func_documentation_string: Handles changes to the selected item.
  @param selectedItem
  @param previousSelectedItem