0
votes

I'm using angular translate with ui router. In my en.json file I have something like

"test-text-url": "I am <a ui-sref=\"my.state\">here</a>"

But when I load the site with that translation verbiage, I only see an anchor tag without the href or ui-sref. So basically just

I am <a>here</a>

If anyone knows how to fix this, that would be awesome. Thank you.

1

1 Answers

0
votes

Look into ng-bind-html and $sce. $sce.trustAsHtml allows you to say that the string you have can be trusted and used for ng-bind-html which would you use in your template. The reason these exist is to prevent xss (chross site scripting)