In my current project using angular v1.5.6, I have html data entered by users with special characters which are stored in the database. For example:
var txt = "<span class='txt_bold'> content with <lessthan signs<span> <span>";
var txt1 = "<span class='txt_bold'> content with <4 lessthan >greaterthan signs <span>";
When I include the above two lines in an ng-bind-html directive, the output I get is as follows:
txt : content with
txt1 : content with <4 lessthan >greaterthan signs
It can be observed that the word after the <(less than) sign from the txt
variable is being removed by the directive.
I have tried solutions suggested in the following threads but unfortunately, none of them worked for me in maintaining the desired HTML CSS effect:
- ng-bind-html work partially than expected
- Insert HTML into view
Any clue or advice on this issue would be greatly appreciated.