Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.
This repository was archived by the owner on May 29, 2019. It is now read-only.

Typeahead values are blank in RC1 #983

Closed
@dmackerman

Description

@dmackerman

Hey guys.

Just so I verify I'm not doing anything wrong, let me walk through some code. This code worked in 1.1.5, but maybe it was a fluke.

I have a service that returns my values for all of my Typeaheads in a promise. Here's a method on that service.

    var getSchools = function(filter) {
      var deferred = $q.defer();
      rpcService.request('Education.autocompleteSchools', { filter: filter }, function(response) {
        var schoolsData = [];
        angular.forEach(response.list, function(value, key) {
          schoolsData.push(value.name);
        });
        deferred.resolve(schoolsData);
      });
      return deferred.promise;
    }

In my template:

<input type="text" autocomplete="off" id="schoolName" name="schoolName" ng-model="education.school" 
                  typeahead="school for school in getSchools($viewValue)" 
                  typeahead-wait-ms="225" 
                  required />

In my controller

    $scope.getSchools = function($viewValue) {
      return TypeAheadService.getSchools($viewValue);
    }

It looks like it's getting the values, but not displaying? Hard to tell. Seems like the data isn't getting there in time or something.

empty
emptydiv

Appreciate all the hard work guys. Great library!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions