0

I'm working on an AngularJS Project and I have a JSON file with all my text in it. I have quite a chunk of text inside it with HTML tags like a break. The problem is when I want to display that text inside my html file it display as plain text like: 'this is text (breaktag<>) I want to use'.

This is the code I'm using to display the text inside my HTML file:

<p translate="requestGenerator.partnershipGenerationOverview.message"></p>

I am using ng-translate.

How can I solve this so that the translate directive uses the HTML tags instead of displaying it with plain text?

1 Answer 1

1

angular-translate provides a post compiling option, which you can either activate globally or for specific translations.

Enable post compiling globally:

app.config(function ($translateProvider) {
  $translateProvider.usePostCompiling(true);
});

Enable post compiling for just this translation:

<p translate="requestGenerator.partnershipGenerationOverview.message"
   translate-compile>
</p>
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.