I’ve an input box which is used to filter out the results among the overall results displayed. I’ve a filter ‘startWith’ for that. Now, I need to highlight the search text among the search results displayed in angularJS.
For e.g., when I type ‘o’ in the search box, it should highlight ‘O’ of the Orange displayed.
Hey. You can use the ng-bind-html directive instead of the interpolation in your ng-repeat and then a filter for your ng-model that will wrap the letters of the words in a span as they are typed:
HTML
<p ng-repeat="obj in myData | filter:search:startWith" ng-bind-html="obj.name | highlightMatch:search.name">