Angular almighty autocomplete Angular almighty autocomplete angularjs angularjs

Angular almighty autocomplete


Just a question: Why don't you use http://angular-ui.github.io/bootstrap/#/typeahead

<h4>Custom templates for results</h4><pre>Model: {{customSelected | json}}</pre><input type="text" ng-model="customSelected" placeholder="Custom template" typeahead="state as state.name for state in statesWithFlags | filter:{name:$viewValue}" typeahead-template-url="customTemplate.html" class="form-control">

I think this is cleaner/easier for you.http://plnkr.co/edit/?p=preview


You are right, you have to change the template a little.

Change this line:

ng-bind-html="suggestion | highlight:searchParam"></li>\

to that:

ng-bind-html="suggestion.name | highlight:searchParam"></li>\

and it should work.


Try including ngSanitize in your module includes.

angular.module("myApp", ["ngSanitize"])