Question

I am using typeahead from Angular Bootstrap. Sample plunker provided by them is here. As you can see $scope.states is filled by the array:

$scope.states = ['Alabama', 'Alaska', 'Arizona', ... ];

And it looks like this:

enter image description here


However, if I change the plunker to an array of numbers, as in this plunker; although you can move your cursor, and it returns you the values starting with the number you have typed; you can't see the content on the dropdown and it looks weird:

enter image description here

Is there a way to make typeahead work with integers?

Était-ce utile?

La solution

There was a bug in the typeahead implementation (see https://github.com/angular-ui/bootstrap/issues/1777) that was fixed yesterday via https://github.com/angular-ui/bootstrap/commit/09678b1260dadb0a399d8e71fc2e1f5597c9ca31. The fix will be part of the next release (0.11.0), for now you can monkey-patch your version based on the change done in the referenced commit.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top