code: function querySearch (query) {
        var results = query ? self.states.filter(createFilterFor(query)) : self.states,
            deferred;
        if (self.simulateQuery) {
          deferred = $q.defer();
          $timeout(function () { deferred.resolve(results); }, Math.random() * 1000, false);
          return deferred.promise;
        } else {
          return results;
        }
      }
docs: ****************************** Internal methods ****************************** 
  Search for states... use $timeout to simulate
  remote dataservice call.