code: function clearSearchText () {
      // Set the loading to true so we don't see flashes of content.
      // The flashing will only occur when an async request is running.
      // So the loading process will stop when the results had been retrieved.
      setLoading(true);
  
      $scope.searchText = '';
  
      // Normally, triggering the change / input event is unnecessary, because the browser detects it properly.
      // But some browsers are not detecting it properly, which means that we have to trigger the event.
      // Using the `input` is not working properly, because for example IE11 is not supporting the `input` event.
      // The `change` event is a good alternative and is supported by all supported browsers.
      var eventObj = document.createEvent('CustomEvent');
      eventObj.initCustomEvent('change', true, true, { value: '' });
      elements.input.dispatchEvent(eventObj);
  
      // For some reason, firing the above event resets the value of $scope.searchText if
      // $scope.searchText has a space character at the end, so we blank it one more time and then
      // focus.
      elements.input.blur();
      $scope.searchText = '';
      elements.input.focus();
    }
docs: Clears the searchText value