javascript - AngularJS UI-Bootstrap Typeahead no matches -


i've been searching around found no question relating this.

i using angular ui-bootstrap typeahead.

so have

<input type="text" ng-model="loc" typeahead="location location in filteredlocations = (locations | filter:$viewvalue)" class="form-control" placeholder="location" /> 

when type shows options in typeahead-popup div. should show, when there no matches, on same popup "no matches found"?

thanks in advance

what can create own results listing. that's easy using typeahead-template-url="customtemplate.html" , this:

<script type="text/ng-template" id="customtemplate.html">   <a>       <img ng-src="http://upload.wikimedia.org/wikipedia/commons/thumb/{{match.model.flag}}" width="16">       <span bind-html-unsafe="match.label | typeaheadhighlight:query"></span>   </a> </script> 

if there no results, return 1 element indicating there's no result. in ng-template can put ng-if checks if it's no-results element , make not clickable. way user can't choose "no results".


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -