Custom JS JSON.stringify

Hi ,
I'm trying to use the "HTML" widget to visualize a Json string stored in the database.
I have included a custom "Js" file with some JavaScript functions to highlight syntax / tags and a function to pass the JSON string from radzen and return the html version of the pretty print json .
However , the HTML component shows the HTML as text and does not embed it in the page.
I have used one of your examples on how to set the value with [innerHTML] .

Sure I'm missing something.

We are not sure what the problem is. Will need some more details.

Casus:
On A radzen page Using the HTML component , inject HTM code .
HTML static code is generated externally Or using JavaScript function and data from database.

Problem : the HTML component does not render the HTML code but displays as text .

Angular by default escapes HTML.

So no way to do so ?
IiFrame and datatype Html? It works if PDF is used in ifrane

Here is what a quick google search returned: https://stackoverflow.com/questions/31548311/angular-html-binding

1 Like

Thank you,
Did not know this behavior of Angular, I'll try asking Google first but, I assumed the radzen component was special and took care of this for us .

Best regards
Mehmet

Hi ,
There are modules that add a pipe for dompurify
how to import these in angular to be used globally ?
I was looking at this gid item:

How to combine this with Radzen ?

Radzen produces a regular Angular application. The instructions from this library's documentation should apply as well.

Are you applying to follow the instruction on the generated application, so after Radzen compilation ?

Not sure what you mean. What I meant was that you can add the required code to the app.module.ts file that Radzen has generated. You can check this blog post too. Just a heads up - Radzen will not recognize the custom pipe in design time.

Thank you , that was the answer I was looking for .
Perhaps it is possible to use custom.modules.ts ?

Not sure what you mean by custom.modules.ts.

1 Like