code: function delayedQuerySearch(criteria) {
        if (!pendingSearch || !debounceSearch())  {
          cancelSearch();
  
          return pendingSearch = $q(function(resolve, reject) {
            // Simulate async search... (after debouncing)
            cancelSearch = reject;
            $timeout(function() {
  
              resolve(self.querySearch(criteria));
  
              refreshDebounce();
            }, Math.random() * 500, true);
          });
        }
  
        return pendingSearch;
      }
docs: Async search for contacts
  Also debounce the queries; since the md-contact-chips does not support this