Angularjs Angular typeahead高亮显示显示的所有属性

Angularjs Angular typeahead高亮显示显示的所有属性,angularjs,typeahead,Angularjs,Typeahead,我有一个typeahead搜索,在那里我显示一个对象的名称、城市和州属性。但过滤器仅应用于名称。当我在搜索框(文本框)中键入字符时,它会列出所有与姓名、城市和州匹配的名称,如果字符与城市或州匹配,这些字符也会高亮显示。我不想突出城市和州 请帮助。 <div ng-repeat="your variables here | filter:name"> 希望这对您有所帮助。 <input type="text" ng-model="clinic.name" typeahead=

我有一个typeahead搜索,在那里我显示一个对象的名称、城市和州属性。但过滤器仅应用于名称。当我在搜索框(文本框)中键入字符时,它会列出所有与姓名、城市和州匹配的名称,如果字符与城市或州匹配,这些字符也会高亮显示。我不想突出城市和州

请帮助。


<div ng-repeat="your variables here | filter:name">
希望这对您有所帮助。


<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是controller中的一个方法,它返回一个cinics数组

感谢您的响应。但上述解决方案对我不起作用。好的。请尝试使用您的ng型号。像这样|过滤器:person.name