title: Typeahead is not working when user types very fast
body: <p>I am using typeahead where on typing its showing suggestions in a search box, while suggestions are getting from the server.</p>
  
  <p>Its working fine except when user types really fast.  For example if we type <strong>storm</strong> it's showing records. When type same word with speed, it's not showing its suggestions while I am getting data in <strong>response</strong>. I have checked by printing <strong>JSON</strong> just above the box so when I write storm fastly its showing <strong>JSON</strong> but not showing below suggestions.</p>
  
  <p>Here is the html</p>
  
  <pre><code>&lt;input type="text" ng-model="header.search"
      typeahead-on-select="searchClicked($item)"
      uib-typeahead="state as state.data.name for state in suggestions | filter:$viewValue | limitTo:8"
      typeahead-min-length="0" placeholder="Søg..." search-products&gt;
  </code></pre>
  
  <p><strong>search-products</strong> is the directive use to broadcast search values. Here is the directive code.</p>
  
  <pre><code>APP.directive('searchProducts', searchProducts);
  function searchProducts($state) {
      return {
          restrict: 'A',
          link: function(scope, element, attrs) {
              scope.$watch(attrs.ngModel, function(searchVal) {
                  scope.$broadcast('searchTheProducts', searchVal);
              });
          }
      };
  }
  </code></pre>
  
  <p>Here is the service call where we are getting data.</p>
  
  <pre><code>$scope.$on('searchTheProducts', function(event, query) {
      if (query) {
          headerService.getSearchSuggestions(query).then(
              function(response) {
                  $scope.suggestions = response;
              },
              function(err) {
                  console.log('Error: ' + err);
              }
          );
      }
  });
  </code></pre>
  
  <p>here is the service logic</p>
  
  <pre><code>  function getSearchSuggestions(query) {
      pendingRequests.cancelAll();
      var url = ApiBaseUrl + "/search/suggestions?query=" + query;
      var deferred = $q.defer();
      pendingRequests.add({
          url: url,
          canceller: deferred
      });
  
      pending = true;
      $http({
          method: "GET",
          url: url,
          timeout: deferred.promise
      }).then(
          function(successData) {
  
              deferred.resolve(successData.data.data);
          },
          function(err) {
  
              deferred.reject(err);
          }
      );
      return deferred.promise;
  }
  </code></pre>