You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 29, 2019. It is now read-only.
I have a typeahead that is working fine but it's not respecting the placeholder text. The reason is because I have a space in my result text.
Here's an example...
<input type="text" id="clientSelected" ng-model="clientSelected" typeahead="client as (client.firstName + ' ' + client.lastName) for client in clients | filter:$viewValue" placeholder="Just start typing...">
The client names are listed as: John Doe, Jane Doe, etc.. so nothing out of the ordinary there. Here is the controller part responsible for populating clients.
$scope.$apply(function() {
// Result has come back from the server
$scope.clients = result;
// Doesn't fix the problem
$scope.clientSelected = '';
});
So, with this implementation my input always has a " " so the placeholder isn't shown and the initial value of ng-model="clientSelected" is a " ". The space in the typeahead between (client.firstName + ' ' + client.lastName) is the reason.
@pkozlowski-opensource asked me to post the issue over here in a response on StackOverflow.
The text was updated successfully, but these errors were encountered:
I have a typeahead that is working fine but it's not respecting the placeholder text. The reason is because I have a space in my result text.
Here's an example...
The client names are listed as: John Doe, Jane Doe, etc.. so nothing out of the ordinary there. Here is the controller part responsible for populating clients.
So, with this implementation my input always has a " " so the placeholder isn't shown and the initial value of ng-model="clientSelected" is a " ". The space in the typeahead between (client.firstName + ' ' + client.lastName) is the reason.
@pkozlowski-opensource asked me to post the issue over here in a response on StackOverflow.
The text was updated successfully, but these errors were encountered: