angularjs - AngularStrap Typeahead randomly selects the display value instead of model value -


i using angularstrap's typeahead directive in several dropdowns , sometimes, display value shows selected value.

for example, if want show number selected value in input field, both number , description selected. here relevant code :

<input type="text" class="form-control"          bs-typeahead         bs-options="x.num (x.num > 0 ? x.num + '. ' + x.description :  '')for x                     in crc.xlist | orderby: 'x.num'"          data-autoselect="true"         data-limit="15"         ng-model="crc.newnum"         ng-model-options="{ debounce: 500 }"         ng-change="crc.getnuminfo(false, true)" /> 

any appreciated - thanks!

i think because of (x.num > 0 ? x.num + '. ' + x.description : ''), think angular replaces empty string when x.num 0 value, try (x.num > 0 ? x.num + '. ' + x.description : 'test') instead , see if fixes ?


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -