In my angular.js application, I have a table that displays elements. The name of these elements sometimes needs to be displayed in bold by adding <b>
and </b>
tags. However, instead of rendering the name as HTML code, it is showing up as a string.
I want to change all instances of text between the <b>
and </b>
tags on the page to be displayed in bold format.
This is what I have tried:
var pattern = new RegExp(nameFilter, "g");
e.name = e.name.replace(pattern, '<span class="highlighted">' + nameFilter + '</span>');
Despite this attempt, the text still appears as a string rather than in bold format.
Any suggestions on how to display the text in bold correctly?