0
votes

I have a typeahead search where I am Displaying Name, City and State properties of an object. But the filter is applied only on name. when I type characters in search box(textbox) It list all the matching names with Name, city and state and If the characters match City or state those will also be highlighted. I don't want city and State to be highlighted.

Please help.

2

2 Answers

0
votes
<div ng-repeat="your variables here | filter:name">

hope this will help you.

0
votes
<input type="text" ng-model="clinic.name" typeahead="clinic.id + '' + clinic.name + '&nbsp;&nbsp;' + clinic.city + '&nbsp;&nbsp;'+ clinic.state for clinic in getClinics($viewValue) | filter:{name: $viewValue} | filter:{deleted: false}" typeahead-on-select="showAssociateClinicModal($item)" typeahead-template-url="customclinicTypeaheadTemplate.html">


<script type="text/ng-template" id="customclinicTypeaheadTemplate.html">
  <a>
    <span ng-bind-html="match.model.id"></span>
    <span ng-bind-html="match.model.name | typeaheadHighlight:query"></span>
    <span ng-bind-html="match.model.city"></span>
    <span ng-bind-html="match.model.state"></span>
  </a>
</script>

getClinics is a method in controller which return an array of cinics