How to clear text from AngularUI typeahead input

I was looking for an answer to this as well, for the longest time. I finally found a resolution that worked for me. I ended up setting the NgModel to an empty string within the typeahead-on-select attribute: In your typeahead-on-select attribute add asyncSelected = ”; behind your select function, like so: <input … typeahead-on-select=”selectMatch(asyncSelected); asyncSelected … Read more

Angular-UI typeahead: show label but bind to value only

It’s not ideal, but the typeahead-input-formatter attribute provides a work-around until a fix can be provided. (Plunker from github thread). HTML: <input type=”text” ng-model=”myModel” typeahead=”o.value as o.text for o in options | filter:$viewValue | limitTo:5″ typeahead-editable=”false” typeahead-input-formatter=”formatLabel($model)” /> AngularJs controller function: $scope.formatLabel = function(model) { for (var i=0; i< $scope.options.length; i++) { if (model === … Read more