Use regex to bold the word in search result which match the search query
<p>I have stored input text value into a variable with id name=search-query.
And then I am searching through the JSON data to find any matching result and then output the result on the screen.
Is there a way which I can bold the word which match the search-query.val?</p>

<pre><code>&lt;body ng-app="products" ng-controller="ctrl"&gt; 

 &lt;input type="text" id="search-query" name="query" placeholder="Enter product name"&gt;&lt;/input&gt;
 &lt;tbody&gt;
       &lt;tr ng-repeat="result in searchResult|orderBy:order:reverse" &gt;  
          &lt;td &gt;
               &lt;a ng-href="{{result.link}}" target="_blank"&gt;
                    &lt;span ng-bind="result.name" target="_blank"&gt;&lt;/span&gt; 
                &lt;/a&gt;
          &lt;/td&gt;
          &lt;td  ng-bind="result.type"&gt;&lt;/td&gt; 
        &lt;/tr&gt;  
 &lt;/tbody&gt; 
&lt;/body&gt;

var app2 = angular.module('products', []);
app2.controller('ctrl', function($scope) {  
$scope.searchResult = []; 
$scope.submit = function(){  
    var search = $("#search-query").val();
    $.each(json.products, function(i, v) {
         var regex = new RegExp(search, "i");

         if (v.name.search(regex) != -1) {  

              // For the following line, is there a way which I can bold the word which match the search-query.val?
              var name = v.name.replace(search, "&lt;b&gt;search&lt;/b&gt;");   // doesn't work

              $scope.searchResult.push({ name:name, type: v.type, link: v.url }); 
              return;
          } 
});   
}   
</code></pre>