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
Post a Comment